diff --git a/layouts/partials/site_footer_license.html b/layouts/partials/site_footer_license.html index 8a97e36d..82d6bf93 100644 --- a/layouts/partials/site_footer_license.html +++ b/layouts/partials/site_footer_license.html @@ -9,14 +9,14 @@ {{ $allow_derivatives := .Params.copyright_license.allow_derivatives | default site.Params.copyright_license.allow_derivatives }} {{ $share_alike := .Params.copyright_license.share_alike | default site.Params.copyright_license.share_alike }} - {{$cc_code := "by"}} - {{ if not $allow_commercial }}{{ $cc_code = printf "%s-nc" $cc_code}}{{end}} - {{ if not $allow_derivatives }} - {{ if $share_alike }} - {{ $cc_code = printf "%s-sa" $cc_code}} - {{else}} - {{ $cc_code = printf "%s-nd" $cc_code}} - {{end}} + {{ $cc_code := "by" }} + {{ if not $allow_commercial }} + {{ $cc_code = printf "%s-nc" $cc_code }} + {{end}} + {{ if and $allow_derivatives $share_alike }} + {{ $cc_code = printf "%s-sa" $cc_code }} + {{ else if not $allow_derivatives }} + {{ $cc_code = printf "%s-nd" $cc_code }} {{end}} {{ $license_url := printf "https://creativecommons.org/licenses/%s/4.0" ($cc_code | urlize) }} @@ -31,12 +31,13 @@ CC icon CC by icon - {{ if not $allow_commercial }}CC NC icon{{end}} - {{ if not $allow_derivatives }} + {{ if not $allow_commercial }} + CC NC icon + {{end}} + {{ if and $allow_derivatives $share_alike }} + CC SA icon + {{ else if not $allow_derivatives }} CC ND icon - {{ if $share_alike }} - CC SA icon - {{end}} {{end}}