mirror of
https://github.com/msfjarvis/msfjarvis.dev.git
synced 2024-06-03 04:18:56 +05:30
layouts: use heading render hook
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
266835b881
commit
ac76633bcd
1
layouts/_default/_markup/render-heading.html
Normal file
1
layouts/_default/_markup/render-heading.html
Normal file
|
@ -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>
|
</p>
|
||||||
<div class="tag-container">
|
<div class="tag-container">
|
||||||
</div>
|
</div>
|
||||||
{{- with .Content -}}
|
{{ .Content }}
|
||||||
{{ . | replaceRE "(<h[1-2] id=\"([^\"]+)\".+)(</h[1-9]+>)" `<a href="#${2}" class="heading-anchor" ariaLabel="Anchor"> ${1}</a> ${3}` | safeHTML }}
|
|
||||||
{{- end -}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ if and .Site.Params.CommentoURL (and (not .Site.BuildDrafts) (not .Site.IsServer)) -}}
|
{{ if and .Site.Params.CommentoURL (and (not .Site.BuildDrafts) (not .Site.IsServer)) -}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user