{{- /* Resolve site-absolute markdown links against baseURL so the site works under a subpath deploy; open external links in a new tab. */ -}} {{- $dest := .Destination -}} {{- $isExternal := or (strings.HasPrefix $dest "http://") (strings.HasPrefix $dest "https://") -}} {{- if and (not $isExternal) (strings.HasPrefix $dest "/") -}} {{- $dest = relURL (strings.TrimPrefix "/" $dest) -}} {{- end -}} {{ .Text }} {{- /* chomp trailing newline */ -}}