Support nav links to a section of a page - #104
Merged
Merged
Conversation
A `nav` entry that links to a section of a page was reported as "not found in the documentation files", which fails `strict` builds: - `page.md#anchor` wasn't recognized as a documentation page and was kept as a literal link to the Markdown file, which is broken on the built site. - `page/#anchor`, the page's URL, worked on the built site but was still reported as not found. When the part before `#` is a documentation page, the link now points at the page's URL plus the anchor (`page/#anchor`, or `page.html#anchor` without directory URLs). Links whose path is the URL of a documentation page are logged at DEBUG level instead of being reported as not found. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
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.
A
naventry that links to a section of a page is reported as "not found in the documentation files", which failsstrictbuilds:Fix:
#is a documentation page, the link now points at the page's URL plus the anchor:about/#license, orabout.html#licensewithuse_directory_urls: false.about/#license) are logged at DEBUG level instead of being reported as not found. Withuse_directory_urls: falsethat URL doesn't exist, so it is still reported.missing.md#x) are still reported, and absolute paths keep followingvalidation.nav.absolute_links.Verified end to end with and without directory URLs: the generated
hrefs are correct from the home page, from nested pages, and for anchors on the current page. The anchor itself isn't validated against the target page; that would have to happen after rendering.The
navsection of the configuration docs now shows how to link to a section of a page.Related Issue
No issue in this repository.
Checklist
docs/about/release-notes.mdupdated (if applicable)🤖 Generated with Claude Code