layouts: use heading render hook
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
266835b881
commit
ac76633bcd
|
@ -0,0 +1 @@
|
|||
<a href="#{{ .Anchor | safeURL }}" class="heading-anchor"><h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}</h{{ .Level}}></h></a>
|
|
@ -9,9 +9,7 @@
|
|||
</p>
|
||||
<div class="tag-container">
|
||||
</div>
|
||||
{{- with .Content -}}
|
||||
{{ . | replaceRE "(<h[1-2] id=\"([^\"]+)\".+)(</h[1-9]+>)" `<a href="#${2}" class="heading-anchor" ariaLabel="Anchor"> ${1}</a> ${3}` | safeHTML }}
|
||||
{{- end -}}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
{{ if and .Site.Params.CommentoURL (and (not .Site.BuildDrafts) (not .Site.IsServer)) -}}
|
||||
|
|
Loading…
Reference in New Issue