feat: Handle relative files#533
Merged
zastrowm merged 3 commits intoFeb 11, 2026
Merged
Conversation
Member
|
/strands review |
mkdocs uses relative links to files while Astro by default uses slugs (and does no built-in validation). Instead of requiring slugs everywhere add an override to do a conversion of links based on the or based on the relative path. An alternative solution would be to do this when converting the docs (e.g. via update-docs.ts) but honestly the devx for linking using slugs everywhere was uglier whereas this is more natural IMHO. Long-term we can probably normalize a bit more, but in the short term this is a good solution. We also started excluding index.md files from the examples directory as they aren't intended to be pages on the docs - they are only present for readability when on GitHub.
08b347a to
aac4700
Compare
Contributor
Documentation Preview ReadyYour documentation preview has been successfully deployed! Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-cms-533/user-guide/quickstart/overview/ Updated at: 2026-02-11T15:21:21.607Z |
Unshure
approved these changes
Feb 11, 2026
3fe76e2
into
strands-agents:workstream/cms-migration
5 of 8 checks passed
This was referenced Feb 17, 2026
Closed
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.
Note: This is targeting the
workstream/cms-migrationbranch - the plan is to do incremental PRs to avoid a single PR with a bunch of code.The northstar that I'm working towards right now is https://starlight-migration.docs-72e.pages.dev/user-guide/quickstart/overview/
Description
Follow up to #505, #525, #527; part 4/N of the CMS migration.
mkdocs uses relative links to files while Astro by default uses slugs (and does no built-in validation). Instead of requiring slugs everywhere add an override to do a conversion of links based on the or based on the relative path.
An alternative solution would be to do this when converting the docs (e.g. via update-docs.ts) but honestly the devx for linking using slugs everywhere was uglier whereas this is more natural IMHO. Long-term we can probably normalize a bit more, but in the short term this is a good solution.
We also started excluding index.md files from the examples directory as they aren't intended to be pages on the docs - they are only present for readability when on GitHub.
Note
The decision being made here is that we'll modify astro/CMS behavior to allow links to files instead of requiring slugs. For instance instead of requiring:
we'll also allow:
as this provides compatability with mkdocs AND it's easier to reason about.
Why is using slugs a worse devx? Because:
You can preview the resulting documentation at https://d3ehv1nix5p99z.cloudfront.net/pr-cms-533/user-guide/quickstart/overview/ - notice that links to non-api pages now works (api doc links will be a follow-up). Compared to the previous build links between pages now work!
Review notes
AutoImportdirectly into the project - you can review this code, but without the full-context I'm not sure it'll make sense - see the PR for more informationType of Change
Checklist
mkdocs serveBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.