From 10df98f2d5028000343d616da4dfd67cecbf9bc8 Mon Sep 17 00:00:00 2001 From: Jeremias Menichelli Date: Mon, 7 Sep 2026 16:00:29 +0200 Subject: [PATCH] feat(kb): Create homepage and pinned topics and guides (#49999) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Adding the ability to pin guides or specific topics to homepage. _To test:_ - Enter the preview of the project - Go to the homepage - Make sure pinned topics, pinned guides and the rest of the links work correctly. _Screenshot_ Screenshot 2026-09-04 at 12-12-37
Home Supabase Knowledge Base ## Summary by CodeRabbit - **New Features** - Added homepage sections for pinned topics, featured guides, all guides, and all topics. - Added reusable cards with titles, descriptions, topic badges, and optional links. - Added support for GitHub-style Markdown alerts, including notes, tips, warnings, and cautions. - Added the ability to mark guides and topics as pinned for homepage featuring. - Added a guide demonstrating supported alert styles. - **Style** - Improved header, hero, and card borders for a more consistent visual treatment. --- apps/kb/src/components/Card.astro | 45 ++++++++++++++ apps/kb/src/components/Header.tsx | 2 +- apps/kb/src/components/Hero.tsx | 2 +- apps/kb/src/content.config.ts | 2 + apps/kb/src/content/guides/sample-guide.md | 1 + apps/kb/src/lib/topics.ts | 46 ++++++++++---- apps/kb/src/pages/index.astro | 71 ++++++++++++++++++++++ 7 files changed, 156 insertions(+), 13 deletions(-) create mode 100644 apps/kb/src/components/Card.astro diff --git a/apps/kb/src/components/Card.astro b/apps/kb/src/components/Card.astro new file mode 100644 index 00000000000..8784427734e --- /dev/null +++ b/apps/kb/src/components/Card.astro @@ -0,0 +1,45 @@ +--- +// Small "glass panel" card, adapted from apps/docs' GlassPanel +// (packages/ui-patterns/src/GlassPanel/index.tsx) — same surface treatment +// (bg-surface-75, hover:border-strong), trimmed to what kb needs: no +// logo/icon-picker machinery, which pulled in next/image and next-themes +// that don't apply to a plain Astro app. +// +// Unlike GlassPanel (always a plain
, link-agnostic — every call site +// in docs wraps it in a Next.js ), this renders as an itself when +// `href` is given. That's only safe because `topics` render as plain, +// non-linked badges — nothing inside the card is itself a link, so there's +// no nested- problem. +import { Badge } from 'ui' + +interface Props { + href?: string + title: string + description?: string + topics?: string[] + class?: string +} + +const { href, title, description, topics = [], class: className } = Astro.props +const Tag = href ? 'a' : 'div' +--- + + +

{title}

+ {description &&

{description}

} + { + topics.length > 0 && ( +
+ {topics.map((topic) => ( + {topic} + ))} +
+ ) + } +
diff --git a/apps/kb/src/components/Header.tsx b/apps/kb/src/components/Header.tsx index 5f7c344da07..f1b9c746a54 100644 --- a/apps/kb/src/components/Header.tsx +++ b/apps/kb/src/components/Header.tsx @@ -7,7 +7,7 @@ import { ThemeToggle } from './ThemeToggle' // search, no user menu, no dashboard link — kb doesn't have any of that yet. function Header() { return ( -
+