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