docs(site): inject LLM-nav banner + 'See also' footer into every .md#37
Merged
Conversation
Mirrors the code.claude.com/docs pattern so any .md fetched by an LLM points back to the site index and surfaces 3-5 related pages. Every per-page .md emitted by starlight-page-actions now starts with a blockquote banner linking /llms.txt and the three scoped bundles (user-guide, mcp, contributing), and ends with a hand-curated "See also" section. The curation lives in packages/docs/scripts/inject-llm-nav.mjs as a RELATED map keyed by page slug — one entry per page. The script runs as an astro-build postbuild step (build = "astro build && node scripts/inject-llm-nav.mjs") and is idempotent.
Closed
theagenticguy
added a commit
that referenced
this pull request
May 1, 2026
…37) ## Summary Makes every per-page markdown file LLM-navigable, matching the pattern at [code.claude.com/docs/en/agent-sdk/python.md](https://code.claude.com/docs/en/agent-sdk/python.md). Every `.md` emitted by `starlight-page-actions` now: 1. **Opens with a blockquote banner** pointing to `/llms.txt` as the site index, plus links to the three scoped bundles (`user-guide`, `mcp`, `contributing`). 2. **Ends with a curated "See also"** section of 3-5 related pages. Example top of `/start-here/install.md`: ``` > ## Documentation Index > Fetch the complete documentation index at: https://theagenticguy.github.io/opencodehub/llms.txt > Use this file to discover all available pages before exploring further. > Scoped bundles: [user-guide](...) · [mcp](...) · [contributing](...) # Install ... ``` Example footer: ``` ## See also * [Quick start](/opencodehub/start-here/quick-start/) * [First query](/opencodehub/start-here/first-query/) * [Troubleshooting](/opencodehub/guides/troubleshooting/) ``` ## Implementation - `packages/docs/scripts/inject-llm-nav.mjs` — postbuild Node script. Walks `dist/**/*.md`, prepends the banner, appends per-slug "See also" links from a curated `RELATED` map. Idempotent (skips files that already start with the banner). Skips `llms.txt` family. - `packages/docs/package.json` — build script becomes `astro build && node scripts/inject-llm-nav.mjs`. ## Curation All 34 pages have explicit "See also" entries. The map is hand-curated (same approach as the Claude docs), not autogenerated, so related-links stay meaningful rather than noisy. ## Test plan - [x] Build: 35 pages + 4 llms*.txt + 3 customSets + 34 patched .md - [x] Banner present on every .md (head check) - [x] Footer present on every .md (tail check) - [x] Re-running the injector is a no-op: `patched 0 .md files, skipped 34 already-patched` - [x] Biome, banned-strings, links-validator all clean - [ ] `curl https://theagenticguy.github.io/opencodehub/start-here/install.md` shows the new header + footer after merge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes every per-page markdown file LLM-navigable, matching the pattern at code.claude.com/docs/en/agent-sdk/python.md.
Every
.mdemitted bystarlight-page-actionsnow:/llms.txtas the site index, plus links to the three scoped bundles (user-guide,mcp,contributing).Example top of
/start-here/install.md:Example footer:
Implementation
packages/docs/scripts/inject-llm-nav.mjs— postbuild Node script. Walksdist/**/*.md, prepends the banner, appends per-slug "See also" links from a curatedRELATEDmap. Idempotent (skips files that already start with the banner). Skipsllms.txtfamily.packages/docs/package.json— build script becomesastro build && node scripts/inject-llm-nav.mjs.Curation
All 34 pages have explicit "See also" entries. The map is hand-curated (same approach as the Claude docs), not autogenerated, so related-links stay meaningful rather than noisy.
Test plan
patched 0 .md files, skipped 34 already-patchedcurl https://theagenticguy.github.io/opencodehub/start-here/install.mdshows the new header + footer after merge