Files
paige-hugo/layouts/_default/_markup/render-link.html
2023-09-15 22:04:50 -07:00

7 lines
374 B
HTML

{{ $external := false }}
{{ if (urls.Parse .Destination).IsAbs }}
{{ $external = not (strings.HasSuffix .Destination site.BaseURL) }}
{{ end }}
{{ $newtab := and $external site.Params.paige.external_link_new_tab }}
<a {{ with .Destination }} href="{{ . }}" {{ end }} {{ if $newtab }} target="_blank" {{ end }} {{ with .Title }} title="{{ . }}" {{ end }}>{{ .Text }}</a>