The Open Framework for Building Agents
docs: feature starter templates in gallery (#4739)
Colton Padden4f2922429423
diff --git a/apps/docs/app/[lang]/templates/page.tsx b/apps/docs/app/[lang]/templates/page.tsxindex 7b61378ec..274b274fd 100644--- a/apps/docs/app/[lang]/templates/page.tsx+++ b/apps/docs/app/[lang]/templates/page.tsx@@ -32,9 +32,17 @@ export const generateStaticParams = () => Object.keys(translations).map((lang) =const templateSummaries = templateManifest.filter(({ unlisted }) => !unlisted).map(- ({ category, description: templateDescription, integrations, slug, title: templateTitle }) => ({+ ({category,description: templateDescription,+ featured,+ integrations,+ slug,+ title: templateTitle,+ }) => ({+ category,+ description: templateDescription,+ featured,integrations,slug,title: templateTitle,diff --git a/apps/docs/app/[lang]/templates/template-gallery.tsx b/apps/docs/app/[lang]/templates/template-gallery.tsxindex f476ed450..3600d0b05 100644--- a/apps/docs/app/[lang]/templates/template-gallery.tsx+++ b/apps/docs/app/[lang]/templates/template-gallery.tsx@@ -1,6 +1,7 @@"use client";import { track } from "@vercel/analytics";+import { Badge } from "@vercel/geistdocs/components/badge";import { Button } from "@vercel/geistdocs/components/button";import {DropdownMenu,@@ -37,7 +38,7 @@ interface TemplateGalleryProps {type TemplateGalleryEntry = Pick<TemplateManifestEntry,- "category" | "description" | "integrations" | "slug" | "title"+ "category" | "description" | "featured" | "integrations" | "slug" | "title">;interface FilterSelectProps<T extends string> {@@ -95,12 +96,19 @@ const TemplateCard = ({}) => (<li><Link- className="flex min-h-36 flex-col rounded-lg border border-gray-alpha-400 bg-background-100 p-4 no-underline outline-none transition-colors hover:border-gray-alpha-500 hover:bg-gray-alpha-100 focus-visible:border-gray-alpha-600 focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-offset-2 focus-visible:ring-offset-background-100 motion-reduce:transition-none"+ className="flex h-full min-h-36 flex-col rounded-lg border border-gray-alpha-400 bg-background-100 p-4 no-underline outline-none transition-colors hover:border-gray-alpha-500 hover:bg-gray-alpha-100 focus-visible:border-gray-alpha-600 focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-offset-2 focus-visible:ring-offset-background-100 motion-reduce:transition-none"href={templatePath(entry.slug)}onClick={onSelect}prefetch={true}>- <h2 className="text-gray-1000 text-heading-16">{entry.title}</h2>+ <div className="flex items-start justify-between gap-3">+ <h3 className="min-w-0 text-gray-1000 text-heading-16">{entry.title}</h3>+ {entry.featured ? (+ <Badge className="shrink-0" variant="blue">+ Featured+ </Badge>+ ) : null}+ </div><p className="mt-2 line-clamp-3 max-w-[90%] text-balance text-[14px] leading-[1.3] text-gray-800">{entry.description}</p>@@ -167,6 +175,9 @@ export const TemplateGallery = ({ entries }: TemplateGalleryProps) => {});}, [category, entries, integration, query]);+ const featuredResults = results.filter((entry) => entry.featured);+ const otherResults = results.filter((entry) => !entry.featured);+useEffect(() => {const normalizedQuery = normalizeSearchQuery(query);if (!normalizedQuery) {@@ -237,22 +248,40 @@ export const TemplateGallery = ({ entries }: TemplateGalleryProps) => {<div aria-live="polite">{results.length > 0 ? (- <ul className="grid list-none gap-4 p-0 sm:grid-cols-2 lg:grid-cols-3">- {results.map((entry) => (- <TemplateCard- entry={entry}- key={entry.title}- onSelect={() =>- track(analyticsEvents.templateOpened, {- category,- integration,- search: query.trim().length > 0,- template: entry.slug,- })- }- />- ))}- </ul>+ <div className="flex flex-col gap-10">+ {[+ { id: "featured-templates", title: "Featured", entries: featuredResults },+ {+ id: "other-templates",+ title: featuredResults.length > 0 ? "More templates" : "Templates",+ entries: otherResults,+ },+ ]+ .filter((group) => group.entries.length > 0)+ .map((group) => (+ <section aria-labelledby={group.id} key={group.id}>+ <h2 className="mb-4 text-heading-20 text-gray-1000" id={group.id}>+ {group.title}+ </h2>+ <ul className="grid list-none gap-4 p-0 sm:grid-cols-2 lg:grid-cols-3">+ {group.entries.map((entry) => (+ <TemplateCard+ entry={entry}+ key={entry.slug}+ onSelect={() =>+ track(analyticsEvents.templateOpened, {+ category,+ integration,+ search: query.trim().length > 0,+ template: entry.slug,+ })+ }+ />+ ))}+ </ul>+ </section>+ ))}+ </div>) : (<div className="flex min-h-48 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-gray-alpha-400 px-6 text-center"><p className="text-heading-16 text-gray-1000">No matching entries</p>diff --git a/apps/docs/lib/templates/manifest.ts b/apps/docs/lib/templates/manifest.tsindex 4277a173a..0086cb587 100644--- a/apps/docs/lib/templates/manifest.ts+++ b/apps/docs/lib/templates/manifest.ts@@ -36,6 +36,7 @@ export interface TemplateGitHubSource {export interface TemplateManifestEntry {slug: string;title: string;+ featured?: boolean;/** Hide from the gallery while keeping the detail page available. */unlisted?: boolean;description: string;@@ -56,6 +57,7 @@ export const templateManifest: TemplateManifestEntry[] = [{slug: "eve-chat-template",title: "Web Chat Agent",+ featured: true,setupPrompt:"Set up the eve chat template in my current workspace using https://github.com/vercel/eve/tree/main/apps/templates/eve-chat-template as the source. Copy the project files, install its dependencies, and follow the repository README to configure it. Preserve the existing project if the workspace is not empty, and tell me about any required environment variables or manual setup steps.",description:@@ -84,6 +86,7 @@ export const templateManifest: TemplateManifestEntry[] = [{slug: "eve-slack-agent",title: "Slack Assistant",+ featured: true,setupPrompt:"Set up the eve Slack agent template in my current workspace using https://github.com/vercel/eve/tree/main/apps/templates/eve-slack-agent-template as the source. Copy the project files, install its dependencies, and follow the repository README to configure it. Preserve the existing project if the workspace is not empty, and tell me about any required environment variables or manual setup steps.",description:@@ -224,6 +227,7 @@ export const templateManifest: TemplateManifestEntry[] = [{slug: "eve-software-factory-template",title: "Software Factory",+ featured: true,setupPrompt:"I want to build a software factory with the eve framework, using the Foreman template. Read the setup instructions at https://ask-foreman.dev/docs/getting-started and follow them. They cover deploying the template, connecting GitHub and Linear, running it locally, and how the pipeline works overall.",description: