Add headline hashes for easier referencing to headlines
This commit is contained in:
parent
07c51d2716
commit
88977f461b
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
<div class="column is-three-quarters">
|
||||
<div class="content">
|
||||
{{ .Content }}
|
||||
{{ partial "headline-hash.html" .Content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
<div class="container is-centered page">
|
||||
<div class="content">
|
||||
{{ .Content }}
|
||||
{{ partial "headline-hash.html" .Content }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
1
layouts/partials/headline-hash.html
Normal file
1
layouts/partials/headline-hash.html
Normal file
@ -0,0 +1 @@
|
||||
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" "${1} <a class=\"headline-hash\" href=\"#${2}\">#</a> ${3}" | safeHTML }}
|
@ -13,7 +13,7 @@
|
||||
{{ i18n "authored_by" }}
|
||||
<b>{{ .Params.author | default .Site.Params.author }}</b>
|
||||
</p>
|
||||
{{ .Content }}
|
||||
{{ partial "headline-hash.html" .Content }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user