hugo-theme-relearn/layouts/partials/permalink.gotmpl

19 lines
488 B
Go Template
Raw Normal View History

{{- $to := .to }}
{{- $abs := .abs }}
2022-11-17 21:12:18 +00:00
{{- $basename := .basename }}
{{- $link := "" }}
{{- if isset . "link" }}
{{- $link = .link }}
2023-09-11 22:10:03 +00:00
{{- else if not $to }}
{{- else if $abs }}
{{- $link = $to.Permalink }}
{{- else }}
{{- $link = $to.RelPermalink }}
{{- end }}
2022-11-17 21:12:18 +00:00
{{- if not $basename }}
{{- $basename = "index" }}
{{- end }}
{{- if and (ne site.Params.disableExplicitIndexURLs true) (eq (substr $link -1) "/") }}
2022-11-17 21:12:18 +00:00
{{- $link = printf "%s%s.html" $link $basename }}
{{- end }}
{{- $link }}