Raise Agent-Friendly Docs score for 2code.akr.moe - #387
Merged
Conversation
Generate llms.txt from the same page catalog as the sitemap, point those links at .md URLs, and serve homepage/product markdown from the same i18n copy as the HTML so parity is not a stub. Honor Accept: text/markdown, replace the JS locale hop with a same-host 302, add a clip-rect llms.txt directive on every page, and publish existing product copy at stable non-/blog URLs so afdocs can sample more than two pages. Co-authored-by: AkaraChen <AkaraChen@users.noreply.github.com>
✅ Deploy Preview for grand-selkie-225f87 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Keep crypto out of Edge middleware, drop XML/txt non-pages from the sampled set, match homepage markdown to HTML segments, and give static HTML pages an hourly revalidate so cache-header-hygiene passes. Co-authored-by: AkaraChen <AkaraChen@users.noreply.github.com>
AkaraChen
marked this pull request as ready for review
August 20, 2026 10:17
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.
The live site scores 59/100 (F) and is capped because afdocs 0.19 only discovers two pages (
single-page-sample)./blogis a built-in non-doc exclusion, so the English homepage plus blog index were the only sampleable HTML pages. This PR keeps the existingsite-config→/llms.txtpipeline (sibling products stay generated, no handwrittenpublic/llms.txt) and makes the real product/blog pages discoverable.Does not invent a
/docssite (that URL stays 404). Does not bind 2code to Hermes/Yoi/vibe-infra.Local verification
Overall Score: 100 / 100 (A+) — 37 pages sampled (uncapped). Every previously failing check is PASS.
cd website && bun testis green.Production will show the new score after this deploys to https://2code.akr.moe.
Checks
/features,/faq,/install,/getting-started(and/zh-cn/…). That gives crawlers ≥5 English HTML pages that are not under/blog. Blog posts stay at/blogfor humans and SEO.llms-txt-directive-htmldisplay:none) pointer near the top of every page: “For AI agents: a documentation index is available at/llms.txt”, plus.md/Accept: text/markdown.llms-txt-directive-md/llms.txt.content-negotiationAccept: text/markdownand servesContent-Type: text/markdownfrom the same handlers as the.mdURLs. Browsers keep HTML.redirect-behaviorwindow.location.replacelocale hop. Same-host HTTP 302 in middleware (cookie +Accept-Language). Crawlers are not redirected. Footer language switch sets the cookie so English still wins.llms-txt-coverage/llms.txtis generated from the same catalog assitemap.ts(app/lib/public-pages.ts). Every catalog HTML page has a.mdtwin listed. Coverage is 100% of sitemap doc pages.llms-txt-links-markdown.mdURLs, not HTML.markdown-content-parity.mdare generated from the same i18n strings as the HTML. Blog index/post markdown includes title, lede, dates, reading time, and body. Header/footer/screenshots markeddata-markdown-ignore. Deleted the handwrittenpublic/index.md/public/zh-cn.mdstubs.cache-header-hygiene/llms.txtand.mdhandlers sendCache-Control: public, max-age=300, must-revalidateplusETag. Static HTML pages userevalidate = 3600./llms-full.txtgetsmax-age=300vianetlify.toml.Human UI / SEO
/#features,/#faq) are unchanged.rel=alternateon the blog indexes (feeds are not sitemap URLs, so afdocs does not treat XML as a docs page).Verify after deploy