Docs ToC Scrollspy Module #798
Closed
Replies: 3 comments 3 replies
0 replies
|
Currently, the template uses the TableOfContents for ToC, which is handled by Hugo internally. String replacing will impact the build performance, which I don't want to do so. There is a workaround to achieve this by customizing ToC via Fragments, however there is a compatibility issue that the template don't have access to the I created an issue hbstack/docs#1028, but I haven't decided how to do it yet, you can share ideas if any. |
1 reply
|
OK, there is the solution.
{{- $vendor := .Get 0 -}}
{{- $name := .Get 1 -}}
{{- partial "icons/icon" (dict "vendor" $vendor "name" $name "size" "1em") | replaceRE "\n" "" | safeHTML -}}
## {{% heading-ico "bootstrap" "house" %}} Heading with icon Please note that the Since |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Docs ToC Scrollspy Module
Automatically update table of content navigation to indicate which heading is currently active in the viewport.
https://hbstack.dev/modules/docs/toc-scrollspy/
All reactions