hugo-theme-relearn/layouts/partials/relLangPrettyUglyURL.hugo

18 lines
466 B
Text
Raw Normal View History

{{- $to := .to }}
{{- $abs := .abs }}
2022-11-17 21:12:18 +00:00
{{- $basename := .basename }}
{{- $link := "" }}
{{- if isset . "link" }}
{{- $link = .link }}
{{- 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 }}