mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 21:02:09 +00:00
938428333e
Statically grab and include webmentions during Hugo builds, no JS involved. Hugo supports making web requests and parsing the resulting JSON, so there was no need to use an external program either.
10 lines
429 B
HTML
10 lines
429 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-labeledby="note-hd">
|
|
<h2 id="note-hd">%s</h2>` ($heading) -}}
|
|
{{ .Content | replaceRE $references $referencesWithHeading | safeHTML -}}
|
|
{{ else -}}
|
|
{{ .Content -}}
|
|
{{ end -}}
|