docs: omit .md pages from llms.txt without removing them completely#2480
docs: omit .md pages from llms.txt without removing them completely#2480webrdaniel wants to merge 4 commits intomasterfrom
Conversation
|
Preview for this PR was built for commit |
|
Cheers. Pls can we add some tests for these special pages, to ensure the .md version work, and also that the HTML version contain the |
|
Preview for this PR was built for commit |
|
Preview for this PR was built for commit |
|
The builds will fail until we deploy it or do we need to make some changes to test assertions in |
|
Preview for this PR was built for commit |
|
The tests should now run correctly against the staging |
|
Great thank you |
Follow-up to #2470. Listing pages in the llms-txt plugin's
excludeRoutesalso drops their/<route>.mdcounterparts from the build, so URLs likehttps://docs.apify.com/sdk.mdstarted returning 404 (raised in #2470 (comment)).This PR moves the exclusion from build time to post-build:
docusaurus.config.js: revertexcludeRoutesback to just/and/search; add a NOTE so future contributors don't re-introduce the regression.scripts/joinLlmsFiles.mjs: addLLMS_INDEX_EXCLUDE_PATTERNSand afilterLlmsIndex()postbuild step that strips matching- [Title](url)entries (and now-empty## Sectionheadings) from the generatedbuild/llms.txt. The.mdfiles stay on disk and continue to serve. Also fixes a pre-existing fire-and-forget race betweenjoinFiles()andsanitizeFile().package.json: add@docusaurus/utilsas a direct dependency (used forcreateMatcher)..github/workflows/test.yaml: add regression tests asserting that/sdk.md,/open-source.md,/api/v2/actor-builds-get.md,/api/v2/dataset-get.md, and/academy/tutorials.mdstill servetext/markdown. Also addsassert_final_content_typeso child-repo homepages (/sdk/js,/sdk/python,/api/client/{js,python},/cli) are checked through their nginx redirects for both HTML andAccept: text/markdownresponses.Net effect: same
llms.txtindex as #2470 produced, but the per-page.mdfiles are restored.Test plan
.md-counterpart and child-repo redirect assertions exercise the regression)npm run buildsucceeds locallybuild/llms.txtsize remains under the 100K limit enforced bynpm run test:llms-sizehttps://docs.apify.com/sdk.md,https://docs.apify.com/open-source.md,https://docs.apify.com/api/v2/actor-builds-get.md