Closed duncan-wither closed 3 years ago
Thanks for bringing this up.
Years back when first porting this theme, to only show h2
headings, you had to do some find-n-replace work. Now that Hugo supports a configurable Table of Contents, it makes since to use it.
Addressed in https://github.com/zwbetz-gh/cupper-hugo-theme/commit/87e1a8608f44d46f6cc34fc54a4ddadbd2999433
Cheers for the fix
Describe the bug The table of contents (toc) generated doesn't include anything other than level two headers, ignoring the
config.yaml
settings.To Reproduce example on the example site
Expected behaviour I'd expect it to behave in accordance with the
config.yaml
settings for the TOC.Screenshots If applicable, add screenshots to help explain your problem.
Additional context A (possibly naiive) fix would be to change the
toc.html
partial to:However it left an extra
<nav>
. It's fine for me, I'm just not sure if that'll confuse the generator or someone at some point.I think the proper fix would to change the
toc.html
to this:And then adjust the css to use the generated class, but there'd be no
aria-labelledby
class, and I'm unsure what that's used for.