2022-11-02 00:14:19 +01:00
|
|
|
{{- $to := .to }}
|
2022-11-15 07:34:06 +01:00
|
|
|
{{- $abs := .abs }}
|
2022-11-17 22:12:18 +01:00
|
|
|
{{- $basename := .basename }}
|
2022-11-19 16:05:59 +01:00
|
|
|
{{- $link := "" }}
|
|
|
|
{{- if isset . "link" }}
|
|
|
|
{{- $link = .link }}
|
2023-09-12 00:10:03 +02:00
|
|
|
{{- else if not $to }}
|
2022-11-19 16:05:59 +01:00
|
|
|
{{- else if $abs }}
|
2022-11-15 07:34:06 +01:00
|
|
|
{{- $link = $to.Permalink }}
|
2022-11-19 16:05:59 +01:00
|
|
|
{{- else }}
|
|
|
|
{{- $link = $to.RelPermalink }}
|
2022-11-15 07:34:06 +01:00
|
|
|
{{- end }}
|
2022-11-17 22:12:18 +01:00
|
|
|
{{- if not $basename }}
|
|
|
|
{{- $basename = "index" }}
|
|
|
|
{{- end }}
|
2023-03-24 18:47:52 +01:00
|
|
|
{{- if and (ne site.Params.disableExplicitIndexURLs true) (eq (substr $link -1) "/") }}
|
2022-11-17 22:12:18 +01:00
|
|
|
{{- $link = printf "%s%s.html" $link $basename }}
|
2022-11-02 00:14:19 +01:00
|
|
|
{{- end }}
|
|
|
|
{{- $link }}
|