Add external_link_new_tab param
This commit is contained in:
6
layouts/_default/_markup/render-link.html
Normal file
6
layouts/_default/_markup/render-link.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{ $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>
|
Reference in New Issue
Block a user