Set params.renderHeadingAnchors = false to disable for a whole page. Set the element attribute anchor = false to disable for a single heading.
8 lines
386 B
HTML
8 lines
386 B
HTML
<h{{ .Level }} id="{{ .Anchor }}" class="heading">
|
|
{{ .Text | safeHTML }}
|
|
{{- $pageWantsAnchors := .Page.Params.renderHeadingAnchors | default true -}}
|
|
{{- $anchorEnabledForThisHeading := .Attributes.anchor | default true -}}
|
|
{{- if and $pageWantsAnchors $anchorEnabledForThisHeading -}}
|
|
<a class="heading__anchor" href="#{{ .Anchor }}">#</a>
|
|
{{- end -}}
|
|
</h{{ .Level }}>
|