mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 01:15:03 +03:00
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`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
1 parent
b13d6c2878
commit
895f016a54
4 files changed
+50
-9
No files matched your search
@@ -62,3 +62,7 @@ If you add a new content collection or top-level route, add a matching redirect
|
||||
(`/kb/<section>/:path+.md` → `/kb/markdown/<section>/: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.
|
||||
@@ -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 },
|
||||
]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
<section>
|
||||
<h2 class="mb-6 text-2xl font-medium text-foreground">All Topics</h2>
|
||||
<ul class="flex flex-col gap-2">
|
||||
{TOPICS.map((topic) => (
|
||||
{visibleTopics.map((topic) => (
|
||||
<li>
|
||||
<a
|
||||
href={`${import.meta.env.BASE_URL}/topics/${topicToSlug(topic.name)}`}
|
||||
|
||||
Reference in new issue
Block a user