mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 18:31:45 +01:00
f3783856ad
* feat: add `article.headingAnchor` parameter * feat: use CSS pseudo-element to display `#` symbol of heading anchor This prevents RSS feed readers and screen readers from seeing an extra `#`. * Deactivate `article.headingAnchor` by default
6 lines
No EOL
203 B
HTML
6 lines
No EOL
203 B
HTML
<h{{ .Level }} id="{{ .Anchor }}">
|
|
{{- if site.Params.Article.HeadingAnchor -}}
|
|
<a href="#{{ .Anchor }}" class="header-anchor"></a>
|
|
{{- end -}}
|
|
{{ .Text | safeHTML }}
|
|
</h{{ .Level }}> |