mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-28 11:02:10 +00:00
613eba7ccf
Temporary measure for use with Goldmark till it drops this see https://github.com/yuin/goldmark/issues/258
14 lines
532 B
HTML
14 lines
532 B
HTML
{{ if .Params.footnote_heading -}}
|
|
|
|
{{ $references := `(<section class="footnotes" role="doc-endnotes">
|
|
<hr>)` -}}
|
|
{{ $heading := .Params.footnote_heading -}}
|
|
{{ $referencesWithHeading := printf `<section class="footnotes" role="doc-endnotes" aria-labelledby="note-hd">
|
|
<h2 id="note-hd">%s</h2>` ($heading) -}}
|
|
|
|
{{ $endnote := `(role="doc-endnote")` }}
|
|
{{ $noEndnote := printf "" }}
|
|
{{ .Content | replaceRE $references $referencesWithHeading | replaceRE $endnote $noEndnote | safeHTML -}}
|
|
{{ else -}}
|
|
{{ .Content -}}
|
|
{{ end -}}
|