Repository navigation
fix: rewrite relative links between docs pages - #40
Merged
Merged
Conversation
Markdown links like [Setup](setup.md) rendered as a literal href that did not resolve. Relative links to .md files now point to the locale-neutral docs route, so each reader gets the page in their own language. Also drop the hard-coded locale from the bundled cross-links and document how to link between pages in the authoring guide. Closes #6
[Medium impact] The PR appears safe to merge; no blocking issues remain. Reviews (2) · Last reviewed commit: "fix: decode HTML entities in page links" · Reviewed by Greptile |
Member
Author
Member
Author
|
@Mergifyio backport version-15-hotfix |
Contributor
✅ Backports have been createdDetails
|
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.
Closes #6
Problem
A Markdown link to a sibling page, such as
[Setup](setup.md), rendered as a literalhref="setup.md". The link did not resolve against the docs route. Also, the bundled docs linked to/app/docs/en/..., so every reader got the English page.Changes
rewrite_page_links()changes relative<a href="….md">links into the locale-neutral route/desk/docs/<path>. The docs browser then opens the page in the reader's language.index.mdfile is its own folder. The#fragmentstays on the link.guides/index.mdkeeps its relative links./,mailto:,#anchor, links to other file types, links with a?query, and links that go above the docs root./desk/docs/<path>without a locale.Tests
There are 3 new tests in
compendium/tests/test_docs.py:./,../,index.md,#fragmentand a German translationNotes
build_overview_payloadstill links to/app/docs/{locale}/.... This PR does not change it.index.mdbecomes/desk/docs. The docs browser then opens the first page.