Repository navigation
fix: unprefix the default dialect in llms.txt links - #713
Open
Bryandero98 wants to merge 1 commit into
Open
Bryandero98 wants to merge 1 commit into
Bryandero98 wants to merge 1 commit into
Conversation
[...slug].astro serves the default dialect (pg) unprefixed - a route like docs/pg/select never exists, only docs/select. llms.txt's getUrl didn't know this and linked every pg page with the pg/ prefix anyway, so all 71 postgres links in the generated file 404'd. Reuses defaultDocsDialect from dialect-docs.ts instead of hardcoding "pg", so this keeps working if the default dialect ever changes. Fixes drizzle-team#705 Co-Authored-By: Claude Sonnet 5 <[email protected]>
This branch has not been deployed
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.
Summary
[...slug].astroserves the default dialect (pg) unprefixed - a route likedocs/pg/selectnever exists, onlydocs/select:llms.txt.ts'sgetUrldidn't know this and prefixed everypgslug withpg/anyway (since the meta-file slugs already carry their directory name as a prefix), so all 71 postgres links in the generatedllms.txt404 - the section most people probably want, sincepgis the default.Fix
Strip the default dialect's own prefix in
getUrlbefore building the URL, reusingdefaultDocsDialectfromdialect-docs.tsrather than hardcoding"pg", so this stays correct if the default dialect ever changes.Verification
Ran the dev server and diffed
/llms.txtbefore/after:All other dialects are untouched (still correctly prefixed). Full test suite (
pnpm test, 29 tests) passes.Fixes #705
🤖 Generated with Claude Code