From 895f016a542e44ae0252440633143bc96eb171df Mon Sep 17 00:00:00 2001 From: Kody Jackson Date: Fri, 2 Oct 2026 08:36:18 -0500 Subject: [PATCH] fix(kb): hide LLM-focused topics from homepage and nav listing (#51139) ## Problem Within the KB, we'll be adding a specific type of content primarily aimed at LLM crawlers (similar in scope to https://vercel.com/i / https://www.runpod.io/articles / https://www.braintrust.dev/articles). These topics don't need as much visibility for human end users of the site, especially within a) the site navigation and b) the KB homepage. ## Solution To allow some topics to be less emphasized, this PR adds in a new `visible` field to elements of the `TOPICS` array and then uses that field to filter out entries from the homepage (pinned topics, all topics) and the navigation (Nav.tsx). This is a more minimal approach than #51099, which was attempting to create a different folder / schema / layout for these entries. ## Preview links https://kb-git-kb-comparsion-topic-supabase.vercel.app/kb, which excludes `Comparison` from the top nav and the `All topics` section. https://kb-git-kb-comparsion-topic-supabase.vercel.app/kb/topics/comparison, which still renders pages tagged with `Comparison`. ## Summary by CodeRabbit * **Updates** * The Comparison topic no longer appears in the main navigation or homepage topic sections, including pinned topics. Its listing page remains available. * Other topics continue to appear in navigation and homepage sections, with their labels and links unchanged. * Homepage pinned topics are selected from the topics shown in the homepage sections. --- apps/kb/AGENTS.md | 4 +++ apps/kb/src/components/Nav.tsx | 4 +-- apps/kb/src/lib/topics.ts | 46 ++++++++++++++++++++++++++++++---- apps/kb/src/pages/index.astro | 5 ++-- 4 files changed, 50 insertions(+), 9 deletions(-) diff --git a/apps/kb/AGENTS.md b/apps/kb/AGENTS.md index 4961098ac51..de2bb5975a3 100644 --- a/apps/kb/AGENTS.md +++ b/apps/kb/AGENTS.md @@ -62,3 +62,7 @@ If you add a new content collection or top-level route, add a matching redirect (`/kb/
/:path+.md` → `/kb/markdown/
/:path+.md`), and check whether `generate-markdown.mjs` needs updating too — the content export falls out of its generic `src/content/**` walk automatically, but per-topic-style listing pages don't. + +## Topic-specific guidance + +Articles tagged with the `Comparison` topic are primarily oriented towards LLM crawlers (and not human readers). Because of this, these articles are hidden from the main site navigation. diff --git a/apps/kb/src/components/Nav.tsx b/apps/kb/src/components/Nav.tsx index 1f93936eefc..aeda0f8fe38 100644 --- a/apps/kb/src/components/Nav.tsx +++ b/apps/kb/src/components/Nav.tsx @@ -11,7 +11,7 @@ import { import { TOPICS, topicToSlug } from '../lib/topics' -const topics = TOPICS.map((topic) => ({ +const visibleTopics = TOPICS.filter((topic) => topic.visible).map((topic) => ({ label: topic.name, href: `${import.meta.env.BASE_URL}/topics/${topicToSlug(topic.name)}`, })) @@ -26,7 +26,7 @@ const resources = [ ] const menus = [ - { label: 'Topics', items: topics }, + { label: 'Topics', items: visibleTopics }, { label: 'Resources', items: resources }, ] diff --git a/apps/kb/src/lib/topics.ts b/apps/kb/src/lib/topics.ts index ca47a0fb1ca..572a3800b3f 100644 --- a/apps/kb/src/lib/topics.ts +++ b/apps/kb/src/lib/topics.ts @@ -5,41 +5,77 @@ // `pinned` topics surface as cards on the homepage (see src/pages/index.astro) // — keep this to a handful so that section stays a highlights row, not a // second copy of the full topic list. +// +// `visible` controls whether the topic appears in nav and homepage sections. +// Topics with `visible: false` still have a working listing page at /topics/[slug]. +// Some topics might not need to be visible to end users since their primary audience +// is LLM crawlers. export const TOPICS = [ { name: 'Migration', description: 'Moving data, schemas, or projects onto Supabase.', pinned: false, + visible: true, }, { name: 'Comparison', description: 'How Supabase compares to other databases and platforms.', pinned: false, + visible: false, + }, + { + name: 'Troubleshooting', + description: 'Common errors and how to resolve them.', + pinned: false, + visible: true, }, - { name: 'Troubleshooting', description: 'Common errors and how to resolve them.', pinned: false }, { name: 'Tutorial', description: 'Step-by-step walkthroughs for building with Supabase.', pinned: true, + visible: true, + }, + { + name: 'Storage', + description: 'Uploading, managing, and serving files.', + pinned: false, + visible: true, }, - { name: 'Storage', description: 'Uploading, managing, and serving files.', pinned: false }, { name: 'Auth', description: 'Authentication, authorization, and user management.', pinned: true, + visible: true, + }, + { + name: 'Database', + description: 'Postgres schemas, queries, and performance.', + pinned: true, + visible: true, }, - { name: 'Database', description: 'Postgres schemas, queries, and performance.', pinned: true }, { name: 'Edge Functions', description: 'Deploying and running serverless functions.', pinned: false, + visible: true, + }, + { + name: 'Queues', + description: 'Background jobs and message processing.', + pinned: false, + visible: true, + }, + { + name: 'Realtime', + description: 'Broadcast, presence, and database changes.', + pinned: false, + visible: true, }, - { name: 'Queues', description: 'Background jobs and message processing.', pinned: false }, - { name: 'Realtime', description: 'Broadcast, presence, and database changes.', pinned: false }, { name: 'Supabase Platform', description: 'Project settings, billing, and infrastructure.', pinned: false, + visible: true, }, ] as const diff --git a/apps/kb/src/pages/index.astro b/apps/kb/src/pages/index.astro index 0ad77523149..1d458621676 100644 --- a/apps/kb/src/pages/index.astro +++ b/apps/kb/src/pages/index.astro @@ -7,7 +7,8 @@ import Layout from '../layouts/Layout.astro' import { TOPICS, topicToSlug } from '../lib/topics' const guides = await getCollection('guides') -const pinnedTopics = TOPICS.filter((topic) => topic.pinned) +const visibleTopics = TOPICS.filter((topic) => topic.visible) +const pinnedTopics = visibleTopics.filter((topic) => topic.pinned) const featuredGuides = guides.filter((guide) => guide.data.pinned) --- @@ -63,7 +64,7 @@ const featuredGuides = guides.filter((guide) => guide.data.pinned)

All Topics

    - {TOPICS.map((topic) => ( + {visibleTopics.map((topic) => (