diff --git a/modules/blox-tailwind/layouts/_partials/site_footer_license.html b/modules/blox-tailwind/layouts/_partials/site_footer_license.html index bc52bfd3..305cd142 100644 --- a/modules/blox-tailwind/layouts/_partials/site_footer_license.html +++ b/modules/blox-tailwind/layouts/_partials/site_footer_license.html @@ -1,14 +1,23 @@ {{/* Display copyright license. */}} {{ $branding := partialCached "functions/get_branding" . "branding" }} -{{ $copyright_license := .Params.copyright.license | default site.Params.hugoblox.copyright.license }} -{{ $notice := .Params.copyright.notice | default site.Params.hugoblox.copyright.notice }} +{{ $page_copyright := .Params.copyright | default dict }} +{{ $site_copyright := site.Params.hugoblox.copyright | default dict }} -{{ if ($copyright_license.enable | default false) }} +{{ $copyright_license := $page_copyright.license | default $site_copyright.license | default dict }} +{{ $notice := $page_copyright.notice | default $site_copyright.notice }} - {{ $allow_commercial := $copyright_license.allow_commercial | default false }} - {{ $allow_derivatives := $copyright_license.allow_derivatives | default false }} - {{ $share_alike := $copyright_license.share_alike | default true }} +{{ $license_type := $copyright_license.type | default "cc" }} + +{{ $license_label := "" }} +{{ $license_url := "" }} +{{ $show_cc_icons := false }} + +{{ $allow_commercial := $copyright_license.allow_commercial | default false }} +{{ $allow_derivatives := $copyright_license.allow_derivatives | default false }} +{{ $share_alike := $copyright_license.share_alike | default true }} + +{{ if eq $license_type "cc" }} {{ $cc_code := "by" }} {{ if not $allow_commercial }} @@ -20,40 +29,47 @@ {{ $cc_code = printf "%s-nd" $cc_code }} {{end}} - {{ $license_url := printf "https://creativecommons.org/licenses/%s/4.0" ($cc_code | urlize) }} + {{ $license_url = printf "https://creativecommons.org/licenses/%s/4.0" ($cc_code | urlize) }} + {{ $license_label = printf "CC %s 4.0" $license_url (replace $cc_code "-" " " | upper) }} + {{ $show_cc_icons = true }} - {{ with $notice }} -
- {{ $processed := replace . "{year}" now.Year }} - {{ $processed = replace $processed "{name}" $branding.organization }} - {{ $processed = replace $processed "{license}" (printf "CC %s 4.0" $license_url (replace $cc_code "-" " " | upper)) }} - {{ $processed | markdownify }} -
+{{ else if eq $license_type "custom" }} + + {{ $custom_label := $copyright_license.label | default $copyright_license.text | default "" }} + {{ $custom_url := $copyright_license.url | default "" }} + {{ if and $custom_label $custom_url }} + {{ $license_label = printf "%s" $custom_url $custom_label }} + {{ else }} + {{ $license_label = $custom_label }} {{ end }} -