Conversation
Expose Markdown versions of Jekyll pages and an llms.txt index so agents can prefer the source docs over rendered HTML.
Keep the site glue limited to head discovery while the Jekyll plugin owns markdown exports and the generated llms.txt output.
Move llms.txt content and section rules into site config so the plugin can be extracted without carrying DevTUI-specific copy or grouping logic.
Let the plugin infer llms.txt sections from existing page metadata so most sites only need to enable it and optionally rename the root section.
a8e0bb5 to
ae85e77
Compare
There was a problem hiding this comment.
Pull request overview
Adds a Jekyll plugin that generates clean, source-oriented Markdown exports of site pages (plus a discoverable llms.txt index) to make documentation easier for LLM agents to consume than themed HTML.
Changes:
- Introduces a Jekyll plugin to export
.mdversions of Markdown-backed pages, stripping front matter / Jekyll-specific attribute markup and rewriting internal links to prefer Markdown exports. - Adds
rel="alternate"discovery links from HTML pages to their Markdown export URLs. - Enables automatic
llms.txtgeneration via site config.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
site/_plugins/markdown_for_llms.rb |
Implements Markdown export generation, link rewriting, and llms.txt generation + site hook wiring. |
site/_includes/head_custom.html |
Publishes Markdown export URLs via <link rel="alternate" type="text/markdown">. |
site/_config.yml |
Enables llms.txt generation and sets the default root section title. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| canonical = normalize_site_path(page.url) | ||
| map[canonical] = export_url | ||
|
|
||
| if canonical == '/' | ||
| map['/index.html'] = export_url | ||
| elsif canonical.end_with?('/') | ||
| map[canonical.chomp('/')] = export_url | ||
| map[normalize_site_path(File.join(canonical, 'index.html'))] = export_url | ||
| elsif canonical.end_with?('.html') | ||
| map[canonical.sub(/\.html\z/, '')] = export_url | ||
| end |
There was a problem hiding this comment.
In build_link_map, canonical is already passed through normalize_site_path, which (via Pathname#cleanpath) strips trailing slashes from paths (except /). As a result, the elsif canonical.end_with?('/') branch is effectively unreachable and mappings like /some/section/index.html won't be added for “pretty” URLs. This can prevent rewrite_markdown_links from rewriting links that target index.html pages. Consider checking page.url.end_with?('/') before normalization and/or explicitly adding a mapping for "#{canonical}/index.html" when the original URL ends with /.
Summary
.mdURLs so LLM agents can read the source docs instead of themed HTMLrel=\"alternate\"and add a rootllms.txtindex for discoveryTesting
bundle exec jekyll build