Always open credit link in new tab

master
Will Faught 5 months ago
parent 33b46de5d5
commit 68bd7d3d62

@ -177,7 +177,7 @@ There is a single parameter object with sensible defaults that can be overridden
color = "#0d6efd" # Bootstrap primary color and theme color for Safari and Windows color = "#0d6efd" # Bootstrap primary color and theme color for Safari and Windows
color_scheme = "auto" # Must be "auto", "dark", or "light" color_scheme = "auto" # Must be "auto", "dark", or "light"
copyright = "" # Appears below the page, above the site credit, if set. Defaults to the site copyright. copyright = "" # Appears below the page, above the site credit, if set. Defaults to the site copyright.
credit = '<a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a>' credit = '<a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige" target="_blank">Paige Theme</a>'
date_format = ":date_long" # Hugo date format date_format = ":date_long" # Hugo date format
description = "" # Site description. Appears above the menu, below the site title, if set. description = "" # Site description. Appears above the menu, below the site title, if set.
edit = "" # File edit URL. Example: "https://github.com/account/project/edit/master/content/%s". edit = "" # File edit URL. Example: "https://github.com/account/project/edit/master/content/%s".

@ -6,20 +6,11 @@
{{ $last := templates.Exists "partials/paige/footer-last.html" }} {{ $last := templates.Exists "partials/paige/footer-last.html" }}
{{ $license := $page.Param "paige.license" | markdownify | and ($page.Param "paige.site.disable_license" | not) }} {{ $license := $page.Param "paige.license" | markdownify | and ($page.Param "paige.site.disable_license" | not) }}
{{ $microdata := $page.Params.paige.page.microdata }} {{ $microdata := $page.Params.paige.page.microdata }}
{{ $theme := "https://github.com/willfaught/paige" }}
{{ $target := partial "paige/func-target.html" (dict "page" $page "url" $theme) }} {{ if $credit }}
{{ if eq $credit nil }}
{{ $targetString := "" }}
{{ with $target }}
{{ $targetString = printf ` target="%s"` . }}
{{ end }}
{{ $credit = printf `<a class="link-secondary text-decoration-none" href="%s"%s>Paige Theme</a>` $theme $targetString | safeHTML }}
{{ else }}
{{ $credit = markdownify $credit }} {{ $credit = markdownify $credit }}
{{ else }}
{{ $credit = `<a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige" target="_blank">Paige Theme</a>` | safeHTML }}
{{ end }} {{ end }}
{{ $credit = $credit | and ($page.Param "paige.site.disable_credit" | not) }} {{ $credit = $credit | and ($page.Param "paige.site.disable_credit" | not) }}

Loading…
Cancel
Save