Skip to content

feat(docs): self-maintaining llms.txt generated from nav.yml#3695

Open
aheritier wants to merge 1 commit into
mainfrom
docs/llms-txt
Open

feat(docs): self-maintaining llms.txt generated from nav.yml#3695
aheritier wants to merge 1 commit into
mainfrom
docs/llms-txt

Conversation

@aheritier

Copy link
Copy Markdown
Contributor

What

Adds a spec-compliant /llms.txt to the edge documentation site (docker.github.io/docker-agent), generated at Hugo build time from docs/data/nav.yml. Adding a page to the nav automatically adds it to llms.txt — it self-maintains, deployed by the existing docs-deploy workflow with no new CI or cron.

Why

The docs describe an agent runtime, so their audience is disproportionately LLMs pulling them into a coding context. llms.txt gives models a curated, single-file index of the documentation. docs/data/nav.yml is already the hand-curated canonical index, so driving generation from it keeps the two in lockstep with zero extra maintenance.

Scope note: This covers the edge/preview site only (which tracks main). The stable docs on docs.docker.com already publish their own llms.txt, llms-full.txt, and per-page .md companions. Links here intentionally point at the github.io edge URLs. A follow-up may propose enumerating docker-agent sub-pages in docker/docs's own llms.txt.

Changes

File Change
docs/hugo.yaml Register a plain-text llms output format, attached to the home page via outputs.home (without which it is never rendered). disableKinds untouched.
docs/layouts/home.llms.txt Template: H1 + blockquote summary + one ## section per nav group with - [title](url): note links (absolute via absURL, note from each page's front-matter description). Flattens both items and groups[].items; hard-fails the build if a nav page is unresolvable or its description is empty.
docs/layouts/_partials/footer.html llms.txt discoverability link.
scripts/docs-check-llms-txt.sh CI-invoked semantic validator: rebuilds the site and asserts llms.txt matches nav.yml's sections, titles, order, count and per-entry URL (position-for-position). Catches template regressions a green build alone would miss.
.github/workflows/docs-lint.yml New llms-txt-check job (pinned Hugo 0.163.0, matching docs-deploy/docs-a11y).
docs/STYLE.md Documents generation, the description requirement, and the CI check.

Validation

  • Local + CI-pinned Hugo 0.163.0 build → llms.txt OK: 102 entries across 7 sections, matching docs/data/nav.yml
  • Validator verified to catch: dropped entries (broken groups[].items traversal), duplicated/wrong same-origin URLs, missing/whitespace-only descriptions, and section-order drift
  • shellcheck clean; ran 25× consecutively with no flakiness
  • Blast radius: low — purely additive output format; existing HTML output, nav, and deploy pipeline untouched. Rollback is a plain revert.

🤖 Generated with human review via the multi-agent workflow (implement → review loop → merge-ready).

Add a spec-compliant (https://llmstxt.org/) /llms.txt to the edge docs
site, generated at Hugo build time from docs/data/nav.yml so it stays
in sync as pages are added — deployed by the existing docs-deploy
workflow with no new CI or cron.

- hugo.yaml: register a plain-text 'llms' output format attached to the
  home page (outputs.home) so it is actually rendered.
- layouts/home.llms.txt: template emitting the H1, blockquote summary,
  and one H2 per nav section with '- [title](url): note' links
  (absolute URLs via absURL; note from each page's front-matter
  description). Flattens both items and groups[].items, and hard-fails
  the build when a nav page is unresolved or its description is empty.
- layouts/_partials/footer.html: add an llms.txt discoverability link.
- scripts/docs-check-llms-txt.sh: CI-invoked semantic validator that
  rebuilds the site and asserts llms.txt matches nav.yml's sections,
  titles, order, count and per-entry URL — catching template
  regressions a green build would miss.
- docs-lint.yml: wire in the new llms-txt-check job (pinned Hugo).
- STYLE.md: document generation, the description requirement, and CI.
@aheritier
aheritier requested a review from a team as a code owner July 16, 2026 19:11
@aheritier aheritier added area/ci CI/CD workflows and pipeline area/docs Documentation changes kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI/CD workflows and pipeline area/docs Documentation changes kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants