Skip to content

docs(site): inject LLM-nav banner + 'See also' footer into every .md#37

Merged
theagenticguy merged 1 commit into
mainfrom
docs/md-nav-footer
Apr 27, 2026
Merged

docs(site): inject LLM-nav banner + 'See also' footer into every .md#37
theagenticguy merged 1 commit into
mainfrom
docs/md-nav-footer

Conversation

@theagenticguy
Copy link
Copy Markdown
Owner

Summary

Makes every per-page markdown file LLM-navigable, matching the pattern at 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

  • Build: 35 pages + 4 llms*.txt + 3 customSets + 34 patched .md
  • Banner present on every .md (head check)
  • Footer present on every .md (tail check)
  • Re-running the injector is a no-op: patched 0 .md files, skipped 34 already-patched
  • Biome, banned-strings, links-validator all clean
  • curl https://theagenticguy.github.io/opencodehub/start-here/install.md shows the new header + footer after merge

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.
@theagenticguy theagenticguy merged commit 560a7a6 into main Apr 27, 2026
15 of 16 checks passed
@theagenticguy theagenticguy deleted the docs/md-nav-footer branch April 27, 2026 18:17
@github-actions github-actions Bot mentioned this pull request Apr 27, 2026
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 was referenced May 1, 2026
@github-actions github-actions Bot mentioned this pull request May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant