diff --git a/_components/LandingPage.tsx b/_components/LandingPage.tsx index 2a6cdae10..c9add24ea 100644 --- a/_components/LandingPage.tsx +++ b/_components/LandingPage.tsx @@ -5,7 +5,11 @@ import { } from "../examples/_components/LearningList.tsx"; import { TutorialIcon } from "../examples/_components/TutorialIcon.tsx"; import { VideoIcon } from "../examples/_components/VideoIcon.tsx"; -import { featuredItems, sidebar } from "../examples/_data.ts"; +import { + cookbookCategories, + featuredItems, + sidebar, +} from "../examples/_data.ts"; function FeaturedStar() { return ( @@ -38,6 +42,7 @@ export default function LandingPage( title={item.title} items={item.items} descriptions={descriptions} + isReference={cookbookCategories.includes(item.title)} /> ); }, diff --git a/examples/_components/LearningList.tsx b/examples/_components/LearningList.tsx index 520545c8c..d38970d6d 100644 --- a/examples/_components/LearningList.tsx +++ b/examples/_components/LearningList.tsx @@ -19,13 +19,20 @@ export function LearningList( title: string; items: SidebarItem[]; descriptions?: Record; + isReference?: boolean; }, ) { const anchor = props.title.toLowerCase().replace(/\s+/g, "-"); return (

- {props.title}  + {props.title} + {props.isReference && ( + + Reference + + )} +   Jump to heading diff --git a/examples/_data.ts b/examples/_data.ts index 3bb3859a1..911fb75c4 100644 --- a/examples/_data.ts +++ b/examples/_data.ts @@ -2067,5 +2067,15 @@ export const featuredItems = [ }, ]; +// Categories that are copy-paste reference snippets rather than +// walkthrough-style guides. The landing page tags these as "Reference" so +// newcomers can tell them apart from tutorial-grade content. +export const cookbookCategories = [ + "File system", + "System", + "Web standard APIs", + "Encoding", +]; + export const sectionTitle = "Examples"; export const sectionHref = "/examples/";