hugo-theme-relearn/layouts/partials/relLangPrettyUglyURL.hugo
2022-11-17 22:12:18 +01:00

14 lines
No EOL
383 B
Text

{{- $to := .to }}
{{- $abs := .abs }}
{{- $basename := .basename }}
{{- $link := $to.RelPermalink }}
{{- if $abs }}
{{- $link = $to.Permalink }}
{{- end }}
{{- if not $basename }}
{{- $basename = "index" }}
{{- end }}
{{- if and (ne .Site.Params.disableExplicitIndexURLs true) (eq (substr $link -1) "/") }}
{{- $link = printf "%s%s.html" $link $basename }}
{{- end }}
{{- $link }}