Skip to content

Generate llms.txt from docs corpus, include page descriptions, and expose per-page .md LLM routes#8

Draft
Copilot wants to merge 7 commits into
mainfrom
copilot/add-llms-route
Draft

Generate llms.txt from docs corpus, include page descriptions, and expose per-page .md LLM routes#8
Copilot wants to merge 7 commits into
mainfrom
copilot/add-llms-route

Conversation

Copy link
Copy Markdown

Copilot AI commented May 20, 2026

llms.txt is now generated from the same docs source as llms-full.txt, but instead of embedding full content it links every docs page to a dedicated markdown endpoint. It now also includes a short per-page description, giving agents a lightweight index plus stable retrieval URLs with quick context.

  • Scope

    • Replace static llms.txt content with a generated docs index.
    • Add one .md route per docs page URL.
    • Add a concise description for each indexed docs page in llms.txt.
    • Keep llms-full.txt behavior intact while refactoring shared logic.
  • What changed

    • Introduced shared llms rendering/data utilities in src/app/llms/_lib.ts:
      • docs entry collection (/docs root + docs children)
      • shared rich-text-to-markdown rendering
      • .md URL mapping helper (/docs/.../llms/docs/....md)
    • Refactored src/app/llms-full.txt/route.ts to consume the shared utilities without changing full-output semantics.
    • Reworked src/app/llms.txt/route.ts to emit:
      • link to /llms-full.txt
      • list of docs pages, each pointing to its own /llms/**/*.md endpoint
      • a short description per page (derived from the first meaningful sentence in rendered doc content)
    • Added dynamic per-page markdown route at src/app/llms/[...slug]/route.ts:
      • serves one docs page per request using the same renderer as llms-full.txt
      • parses .md suffix from the slug path
      • validates/decodes slug segments and returns 404 for invalid/non-doc paths
    • Updated generated links to same-origin paths to work correctly across preview environments.
  • Example

    // llms.txt entry generation
    output.push(`- [${title}](${toLlmsMdPath(entry.url)}): ${description}`)
    
    // e.g. /docs/getting-started -> /llms/docs/getting-started.md

Copilot AI and others added 4 commits May 20, 2026 12:53
Agent-Logs-Url: https://github.com/alineacms/alineacms.com/sessions/7f6c13f0-c882-4bb0-8e26-10b1ab9dde45

Co-authored-by: benmerckx <10584189+benmerckx@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
alineacms.com Ready Ready Preview, Comment May 20, 2026 2:20pm

Request Review

@benmerckx
Copy link
Copy Markdown
Member

@copilot The linked .md sub routes give a 404

Copy link
Copy Markdown
Author

Copilot AI commented May 20, 2026

@copilot The linked .md sub routes give a 404

Fixed in a25e10c. The .md links in llms.txt are now same-origin, and the route was moved to src/app/llms/[...slug]/route.ts with explicit .md suffix parsing so /llms/**/*.md resolves correctly (verified with 200 responses for /llms/docs.md and /llms/docs/getting-started.md).

Copilot AI requested a review from benmerckx May 20, 2026 13:35
@benmerckx benmerckx requested review from cloetensbrecht and removed request for benmerckx May 20, 2026 13:58
@benmerckx benmerckx removed their assignment May 20, 2026
@benmerckx
Copy link
Copy Markdown
Member

@copilot feedback from @cloetensbrecht:

Nu nog een description erbij en we zijn rond :)
https://alineacmscom-git-copilot-add-llms-route-alinea-cms.vercel.app/llms.txt

Iets als
Check: Configure a check field to input boolean data

Agent-Logs-Url: https://github.com/alineacms/alineacms.com/sessions/999934ef-199c-4b26-b237-c719cbd7ccf8

Co-authored-by: benmerckx <10584189+benmerckx@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented May 20, 2026

@copilot feedback from @cloetensbrecht:

Nu nog een description erbij en we zijn rond :)
...

Done in fae1126 (with main change introduced in 07e5e73). llms.txt now includes a short description after each docs link, e.g. - [Check](/llms/docs/configuration/fields/check.md): A check field is used to input boolean data. Screenshot of updated output: /tmp/llms-txt-screenshot.png.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • alineacmscom-git-copilot-add-llms-route-alinea-cms.vercel.app
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1187/chrome-linux/headless_shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1187/chrome-linux/headless_shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate,AutoDeElevate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Generate llms.txt from docs corpus and expose per-page .md LLM routes Generate llms.txt from docs corpus, include page descriptions, and expose per-page .md LLM routes May 20, 2026
Copilot AI requested a review from benmerckx May 20, 2026 14:21
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.

2 participants