Add headline hashes for easier referencing to headlines

This commit is contained in:
kolaente 2020-05-06 21:02:14 +02:00
parent 07c51d2716
commit 88977f461b
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,7 @@
</div>
<div class="column is-three-quarters">
<div class="content">
{{ .Content }}
{{ partial "headline-hash.html" .Content }}
</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
<div class="container is-centered page">
<div class="content">
{{ .Content }}
{{ partial "headline-hash.html" .Content }}
</div>
</div>

View File

@ -0,0 +1 @@
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" "${1}&nbsp;<a class=\"headline-hash\" href=\"#${2}\">#</a> ${3}" | safeHTML }}

View File

@ -13,7 +13,7 @@
{{ i18n "authored_by" }}
<b>{{ .Params.author | default .Site.Params.author }}</b>
</p>
{{ .Content }}
{{ partial "headline-hash.html" .Content }}
</div>
</div>