Files
Kody Jackson 895f016a54 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 -->
2026-10-02 08:36:18 -05:00

3.0 KiB

Development

When starting the dev server, run:

# From the root directory of the project
pnpm dev:kb

# From the apps/kb directory
pnpm dev

Astro documentation

Full documentation: https://docs.astro.build

Consult these guides before working on related tasks:

Build

To run a full production build, run:

# From the root directory of the project
pnpm build:kb

# From the apps/kb directory
pnpm build

Authoring content

Content lives under src/content/guides/*.{md,mdx}. Keep it plain GitHub-Flavored Markdown:

  • No custom/JSX components in guide bodies — content is also exported as plain .md (see below), and a component wouldn't survive that export.
  • For callouts, use GitHub's native alert syntax (> [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION]) — the build renders these into the Admonition component for you (src/lib/mdx/rehype-admonitions.ts). Don't import or use Admonition directly in content.
  • Frontmatter requires title, description, and topics (values must match TOPIC_NAMES in src/lib/topics.ts); pinned and github_url are optional. See src/content.config.ts for the full schema.

Pages and markdown export

Each content collection renders through a matching catch-all page — e.g. src/content/guides/** → src/pages/guides/[...slug].astro → GuideLayout. Topic pages (src/pages/topics/[topic].astro) are generated from the TOPICS list in src/lib/topics.ts, not from content files.

Separately, scripts/generate-markdown.mjs runs as a prebuild step and exports every content file — plus one page per topic, listing its guides — as a plain .md file under the gitignored public/markdown/, mirroring the page's URL with a .md extension. vercel.json permanently redirects <page>.md requests to these generated files, one redirect entry per route section (guides, topics).

If you add a new content collection or top-level route, add a matching redirect in vercel.json (/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.