Fix in-page anchors broken by the HonKit migration - #673
Merged
Conversation
HonKit builds heading ids differently from GitBook: it drops backticks, `<`, `>` and `_` from the heading text. The links written for GitBook therefore stopped resolving once fluent#671 and fluent#672 made HonKit the renderer for the published site. | heading | GitBook id | HonKit id | | --------------------------- | -------------------------------------- | -------------- | | `### `add_http_headers`` | add_http_headers | addhttpheaders | | `### `<inject>` Section` | less-than-inject-greater-than-section | inject-section | 15 links across 6 files, 8 distinct anchors: * input/http.md #add_http_headers, #decompression_size_limit * input/syslog.md #source_host_key * output/http.md #allowed_hosts * output/exec_filter.md #less-than-{inject,extract}-greater-than-section * output/file.md #less-than-buffer-greater-than-section * deployment/system-config.md #less-than-source_only_buffer-greater-than-section Verified by building the site with the repository's own configuration and matching every `href="#..."` against the `id=` and `name=` attributes on the same page. Before this change 8 of the 2366 in-page anchors did not resolve; after it, none are left. The new ids were read out of the generated HTML rather than derived from the rule by hand. Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
✅ Deploy Preview for fluentd-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
HonKit builds heading ids differently from GitBook: it drops backticks,
<,>and_from the heading text. The links written for GitBook therefore stopped resolving once #671 and #672 made HonKit the renderer for the published site.###add_http_headers``###Section15 links across 6 files, 8 distinct anchors:
Verified by building the site with the repository's own configuration and matching every
href="#..."against theid=andname=attributes on the same page. Before this change 8 of the 2366 in-page anchors did not resolve; after it, none are left.The new ids were read out of the generated HTML rather than derived from the rule by hand.