Repository navigation
fix: emit absolute URLs in llms.txt, llms-full.txt, and sitemap - #64
Merged
Merged
Conversation
Bots read llms.txt and llms-full.txt as standalone documents, so the root-relative targets in them resolved against the host root. The site is served under /docs, so every one of those links 404'd. Prefix page targets with the docs base path in llms.txt, and rewrite root-relative markdown targets and HTML hrefs in llms-full.txt as the text leaves the app. Content files keep writing root-relative links, which Next resolves against basePath for in-app navigation. Collapse the base URL into one constant that sitemap.ts and both routes share. Drop changefreq and priority from sitemap entries, which Google ignores, and the hardcoded root entry that duplicated the index page. The index is emitted without a trailing slash so it resolves in one redirect.
trichardswp
approved these changes
Sep 22, 2026
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.
Why
llms.txtandllms-full.txtare fetched as standalone documents, butwrote their links as root-relative paths. The site is served under
/docs, so every one of those links resolved against the host root and404'd. A bot following
llms.txtreached nothing.sitemap.xmlfrom the same build already wrote fully absolute URLs, sothis was a generator inconsistency rather than a platform limit.
What Changed
Every link in
llms.txtandllms-full.txtis now absolute underhttps://api.whitepages.com/docs. Inllms.txtthat means the pagetargets; in
llms-full.txt, the markdown targets and HTMLhrefattributes carried in from the MDX bodies are rewritten as the text
leaves the app.
Content files keep writing root-relative links — Next resolves those
against
basePathfor in-app navigation, so the rewrite belongs at theroute boundary, not in the MDX.
sitemap.tsand both routes now share one base-URL constant.Also in this change
sitemap.xmldropschangefreqandpriorityfrom every entry, whichGoogle ignores.
It also drops a hardcoded root entry that duplicated the index page —
the sitemap listed both
/docsand/docs/. The index is emittedwithout the trailing slash, since
/docs/normalizes to/docswith a308 before the 307 on to getting-started, and the bare form resolves in
one hop.
Verification
Checked against a built server (
next build, thennext start):llms.txtllms-full.txthrefsitemap.xmlchangefreq/priorityEvery one of the 63
llms.txttargets was fetched: 62 return 200, andthe index returns a single 307 to getting-started. No 404s. All 62
sitemap entries resolve the same way.
just validatepasses.