I’ve been trying to find a way to insert a partial just before the footnote section but to no avail.
Is there something else that I haven’t found? I understand this is not yet a supported feature–like using .Body
.Footnote
–so maybe there is hackish way to do this?
I tried using split
+ index
but I can not target the last index, which in an article, that can change.
{{ range $i, $c := split .Content "</div>" }}
{{ $c | safeHTML }}</div>
{{ if eq $i 10 }}
insert content here
{{ end }}
{{ end }}
It is possible to add some anchor/marker after each content (end of .md file) but that means I have to edit existing posts.
I also considered using the shortcode feature but unfortunately it also mean I have to edit existing content, something I want to avoid.
Is there another way to approach this?
This is partial I want to add just before the footnote section:
{{ $seriescontent := .Site.RegularPages.RelatedIndices . "series" }}
{{ with $seriescontent }}
<p>{{ i18n "partofseries" }} {{ range ( $.GetTerms "series" ) }}<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>{{ end }}</p>
<ul>
{{ range .Reverse }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
Placing it after {{ .Content }}
places it after the footnote section if there is any. Place it before {{ .Content }}
is awkward as far as the flow/design of some themes I’m using (this is my last resort).
Thank you!