Use external link policy for icon URLs

This commit is contained in:
Will Faught
2023-09-24 19:11:01 -07:00
parent de0f896432
commit a93d52fd73
3 changed files with 13 additions and 9 deletions

View File

@@ -0,0 +1,8 @@
{{ $params := . }}
{{ $page := $params.page }}
{{ $url := $params.url }}
{{ $external := cond (urls.Parse $url).IsAbs (not (strings.HasSuffix $url site.BaseURL)) false }}
{{ return cond (and $external ($page.Param "paige.external_link_new_tab" | not | not)) "_blank" "" }}