Docs ToC Scrollspy Module #798
Replies: 3 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
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/
Beta Was this translation helpful? Give feedback.
All reactions