mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2025-02-20 05:30:04 +00:00

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 -}}
|