PaperModX/layouts/partials/inline_links.html
Reorx 886aafac1f inline_links partial
finally find a way to determine whether a section/term page has archives or not
by conquering hugo's faultiness of .RelPermalink
2022-09-08 23:36:35 +08:00

12 lines
524 B
HTML

<div class="inline-links">
{{/* use `.GetPage "archives"` causes term page to get the root archives */}}
{{/* trim relURL prefix because .RelPermalink includes the path of base url */}}
{{ $archivesPath := printf "/%sarchives" (strings.TrimPrefix (relURL "") .RelPermalink) }}
{{- with .GetPage $archivesPath -}}
<span><a href="{{ .RelPermalink }}">Archives</a></span>
{{- end -}}
{{- with .OutputFormats.Get "rss" -}}
<span><a href="{{ .Permalink }}" target="_blank">RSS</a></span>
{{- end -}}
</div>