mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 21:02:09 +00:00
Allow adding a heading to the endnotes section
This commit is contained in:
parent
59b12ee290
commit
4d297de4ea
3 changed files with 9 additions and 1 deletions
|
@ -9,6 +9,7 @@ tags:
|
|||
- security
|
||||
- fun
|
||||
title: Becoming physically immune to brute-force attacks
|
||||
footnote_heading: References and endnotes
|
||||
---
|
||||
|
||||
This is a tale of the intersection between thermal physics, cosmology, and a tiny
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{{ end }}
|
||||
</header>
|
||||
<section class="e-content" itemprop="articlebody">
|
||||
{{ .Content -}}
|
||||
{{ partial "processed-content" . -}}
|
||||
</section>
|
||||
</article>
|
||||
<br>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{{ if .Params.footnote_heading -}}
|
||||
{{ $references := `(<section class="footnotes" role="doc-endnotes")` -}}
|
||||
{{ $heading := .Params.footnote_heading -}}
|
||||
{{ $referencesWithHeading := printf `${1} aria-labeledby="note-hd">
|
||||
<h2 id="note-hd">%s</h2` ($heading) -}}
|
||||
{{ .Content | replaceRE $references $referencesWithHeading | safeHTML -}}
|
||||
{{ end -}}
|
Loading…
Reference in a new issue