Simplify heading rendering

This commit is contained in:
Michael Schnerring 2021-10-15 14:22:46 +02:00
parent cd1f9f5811
commit 611f836e02
4 changed files with 3 additions and 3 deletions

View File

@ -0,0 +1 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} <a href="#{{ .Anchor | safeURL }}" class="anchor" aria-hidden="true">#</a></h{{ .Level }}>

View File

@ -31,7 +31,7 @@
{{ partial "sidebar/docs-toc.html" . }}
</nav>
{{ end -}}
{{ partial "main/headline-hash.html" .Content }}
{{ .Content }}
{{ if .Site.Params.editPage -}}
{{ partial "main/edit-page.html" . }}
{{ end -}}
@ -45,4 +45,4 @@
-->
</main>
</div>
{{ end }}
{{ end }}

View File

@ -1 +0,0 @@
{{ . | replaceRE "(<h[2-9] id=\"([^\"]+)\".+)(</h[2-9]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true">#</a> ${3}` | safeHTML }}