Restore heading self links
It was a change I did not notice when upgrading Docsy from 0.8.0 to 0.11.0. Docsy changed the way heading self links are generated: they used to be rendered with JS and now they use a Hugo render hook. This means two things: - We need to enable them explicitly by overriding the `_default/_markup/render-heading.html` template. - We need to add the self heading ourselves to headings that are not rendered by Hugo, i.e. HTML headings that we create ourselves. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>pull/2007/head
parent
d67dd88457
commit
97601f12ff
@ -0,0 +1 @@
|
||||
{{ template "_default/_markup/td-render-heading.html" . }}
|
@ -0,0 +1,11 @@
|
||||
{{- /*
|
||||
|
||||
A copy of the private "_default/_markup/_td-heading-self-link.html" template
|
||||
in Docsy's "_default/_markup/_td-render-heading.html" partial to be able to
|
||||
reuse it when the title has custom markup.
|
||||
|
||||
Takes a string which is the ID of the heading.
|
||||
|
||||
*/ -}}
|
||||
|
||||
<a class="td-heading-self-link" href="#{{ . | safeURL }}" aria-label="Heading self-link"></a>
|
Loading…
Reference in New Issue