Repository navigation
Conversation
Implements the llmstxt.org v2 proposal: - /llms.txt at the root: site map with per-show and core-page links - /show/<slug>/llms.txt per show: full episode index (date, title, guests, description) newest-first, linking markdown twins - /llms-full.txt: concatenated core (non-episode) pages - markdown twins for every page/section at <url>index.md via Hugo output formats (episode template includes show notes, hosts, guests, duration, audio/video links) - discovery link relations in <head>: rel=describedby -> /llms.txt, rel=alternate type=text/markdown -> page twin - nginx serves .md with Content-Type text/markdown Indexes are generated at container build time (scripts/gen_llms.py consumes an NDJSON dump Hugo emits during the build, then removes it), so they regenerate on every deploy, including scraper auto-commits: no drift between content and llms files is possible. Tests: unit tests for the generator (test/test_llms_gen.py) and e2e checks of the served files (test/e2e/test_llms.py). Verified with a full docker build of this branch: /llms.txt, /llms-full.txt, all 8 show indexes, and page twins serve correctly.
Per PR review: /show/<slug>/llms.txt listed every past episode (600+ entries, ~190 KB for LINUX Unplugged). The llms.txt spec treats these files as curated maps, not full inventories. Each show file now contains: - show description + link to the show page markdown twin - the 10 most recent episodes with dates, guests, and summaries - the episode number range and URL pattern with oldest/newest examples - a link to /show/<slug>/episodes.json: a generated JSON list of every episode (number, date, URL) for programmatic enumeration episodes.json is emitted because Hugo 0.105 predates per-section sitemaps (added in 0.108), so the spec's sitemap.xml pointer has no per-section target on this site. Also fixes markdown twins for taxonomy/term pages (e.g. /hosts/) by adding taxonomy/term outputs, and updates unit + e2e tests. Verified with full Docker build: all llms.txt markdown-twin links return 200 text/markdown; per-show files 3.5-3.8 KB.
Add llms.txt support: auto-updating indexes + markdown page twins
Collaborator
|
Thanks for the contribution! I am currently just getting back from being out of town. I will look this over as soon as I can |
Collaborator
|
So I was looking through and I think it would make more sense for this to be done with Hugo itself rather than a python script during the docker build. You should be able to use custom output formats and templates similar to what you are doing.
Going this route:
I do love the idea of making the site more LLM friendly. Let me know if you have any questions. |
…ript Implements the maintainers' review feedback: everything is now Hugo-native. - New output formats: llms/llmsfull (text/plain) on home, llms/episodes on show sections via 'outputs' front matter in each show's _index.md, so they don't render on /show/, /hosts/, /guests/. - Templates: index.llms.txt, index.llmsfull.txt, show/list.llms.txt, show/list.episodes.json; partials/llms-body.html strips TOML front matter from markdown twins. - URLs from .Permalink; canonical slugs from .Params.slug (0650.md -> 650). - Episode ranges from .Params.episode type check (int/float64 = numbered, string = special), so the-launch 'T-' and office-hours 'p' episodes work and 4-digit episode numbers will too. - Episode enumerations filter 'where .Pages "Type" "episode"' (section .Pages includes taxonomy/_index ghosts). - head.html describedby now points at the show-scoped llms.txt for pages under a show, root llms.txt elsewhere. - Dockerfile: python stage and llms cleanup steps removed (builder->nginx). - e2e tests rewritten as pure-HTTP (requests), incl. T-/p episode and non-show 404 coverage; 8/8 pass against the built image.
Generate llms.txt with Hugo output formats (drop the Python build script)
Author
|
Sure, makes sense. I've pushed some updates to the PR to implement it with just Hugo as you suggest, and handle the "T", "p", and 1000+ numbered episodes. |
This branch has not been deployed
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.
(Developed in collaboration with my Hermes agent. Reviewed and verified working in a local docker container by me, the human)
Implements the llmstxt.org v2 proposal so LLM agents can navigate the site:
/llms.txt/show/<slug>/llms.txt× 8/llms-full.txt<url>index.mdtwinsHTML pages get spec discovery links:
rel="describedby"→/llms.txt,rel="alternate" type="text/markdown"→ the page twin.How it stays current
No scheduled job, no committed generated files.
scripts/gen_llms.pyruns in the Docker builder stage on every build and regenerates everything from Hugo's own rendered data (an NDJSON dump emitted duringhugo --gc, then deleted). Deploys already fire on every push to main, including scraper auto-commits, so new episodes land in the indexes automatically. Drift is structurally impossible.Notes for review
llmsstage (python:3.12-alpine) because the pinned hugo image's apk repos resolve to current Alpine and its python3 fails to load against the image's musl. Final stage now copiespublic/fromllmsinstead ofbuilder.text/markdownmime mapping, so alocation ~ \.md$block sets the content type. The inserted blocks repeatrootbecause the stock conf declares it insidelocation /./show/linux-unplugged/650/, numeric slug), not content filenames (0650.md).config.toml:[outputs] homenow explicitly lists["html", "rss", "json", "llmsdump"](previously Hugo defaults) — no behavior change for existing formats.Verification (full
docker buildof this branch + served-container checks)/llms.txt,/llms-full.txt, all 8/show/<slug>/llms.txt: 200, spec-conformant structure (H1 → blockquote → H2 file lists)/show/linux-unplugged/650/index.md,/membership/index.md,/live/index.md: 200text/markdown<link rel="describedby" href="/llms.txt">+ markdownalternatepresent on pagestest/test_llms_gen.py4/4; e2e checks added intest/e2e/test_llms.py