mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-28 19:43:31 +08:00
feat: add article.headingAnchor
parameter
This commit is contained in:
parent
130e2f6607
commit
bdf2a710d3
@ -28,6 +28,7 @@ params:
|
|||||||
src: img/avatar.png
|
src: img/avatar.png
|
||||||
|
|
||||||
article:
|
article:
|
||||||
|
headingAnchor: true
|
||||||
math: false
|
math: false
|
||||||
toc: true
|
toc: true
|
||||||
readingTime: true
|
readingTime: true
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<h{{ .Level }} id="{{ .Anchor }}">
|
<h{{ .Level }} id="{{ .Anchor }}">
|
||||||
<a href="#{{ .Anchor }}" class="header-anchor">#</a>
|
{{- if site.Params.Article.HeadingAnchor -}}
|
||||||
|
<a href="#{{ .Anchor }}" class="header-anchor"></a>
|
||||||
|
{{- end -}}
|
||||||
{{ .Text | safeHTML }}
|
{{ .Text | safeHTML }}
|
||||||
</h{{ .Level }}>
|
</h{{ .Level }}>
|
Loading…
Reference in New Issue
Block a user