18 lines
466 B
Plaintext
18 lines
466 B
Plaintext
|
{{- $to := .to }}
|
||
|
{{- $abs := .abs }}
|
||
|
{{- $basename := .basename }}
|
||
|
{{- $link := "" }}
|
||
|
{{- if isset . "link" }}
|
||
|
{{- $link = .link }}
|
||
|
{{- else if $abs }}
|
||
|
{{- $link = $to.Permalink }}
|
||
|
{{- else }}
|
||
|
{{- $link = $to.RelPermalink }}
|
||
|
{{- 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 }}
|