From 2f087466939ea29efb6913f84405aa397c098aa9 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Sat, 28 Dec 2024 00:00:40 +0100 Subject: Attribution in footer to isolated partial --- layouts/partials/attribution.html | 61 ++++++++++++++++++++++++++++++++++++++ layouts/partials/footer.html | 62 +-------------------------------------- 2 files changed, 62 insertions(+), 61 deletions(-) create mode 100644 layouts/partials/attribution.html diff --git a/layouts/partials/attribution.html b/layouts/partials/attribution.html new file mode 100644 index 0000000..0565131 --- /dev/null +++ b/layouts/partials/attribution.html @@ -0,0 +1,61 @@ +
+ {{ if in (slice "by" "by-nd" "by-sa" "by-nc" "by-nc-nd" "by-nc-sa") .license }} + {{ $href := printf "http://creativecommons.org/licenses/%s/4.0/" .license }} +
+ The content in this website + by + {{ with .Author.homepage }} + + {{ $.Author.name }} + + {{ else }} + {{ $.Author.name }} + {{ end }} + + is licensed under a + + Creative Commons + {{ with .license }} + Attribution{{- if in . "by-nc" -}} + -NonCommercial + {{- end -}}{{- if in . "-nd" -}} + -NoDerivatives + {{- else if in . "-sa" -}} + -ShareAlike + {{- end -}} + {{ end }} + 4.0 International License + + + + {{ with .license }} + {{ if in . "by-nc" }} + + {{ end }}{{ if in . "-nd" }} + + {{ else if in . "-sa" }} + + {{ end }} + {{ end }} + + +
+ {{ else }} + Copyright © + {{ now.Format "2006" }} + {{ .Author.name }} + {{ end }} +
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 4d7b541..8a58e75 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -25,68 +25,8 @@ {{ .Content }} {{ end }} + {{ partial "attribution.html" .Site.Params }} -
- {{ if in (slice "by" "by-nd" "by-sa" "by-nc" "by-nc-nd" "by-nc-sa") .Site.Params.license }} - {{ $href := printf "http://creativecommons.org/licenses/%s/4.0/" .Site.Params.license }} -
- The content in this website - by - {{ with .Site.Params.Author.homepage }} - - {{ $.Site.Params.Author.name }} - - {{ else }} - {{ $.Site.Params.Author.name }} - {{ end }} - - is licensed under a - - Creative Commons - {{ with .Site.Params.license }} - Attribution{{- if in . "by-nc" -}} - -NonCommercial - {{- end -}}{{- if in . "-nd" -}} - -NoDerivatives - {{- else if in . "-sa" -}} - -ShareAlike - {{- end -}} - {{ end }} - 4.0 International License - - - - {{ with .Site.Params.license }} - {{ if in . "by-nc" }} - - {{ end }}{{ if in . "-nd" }} - - {{ else if in . "-sa" }} - - {{ end }} - {{ end }} - - -
- {{ else }} - Copyright © - {{ now.Format "2006" }} - {{ .Site.Params.Author.name }} - {{ end }} -
Made in anger with -- cgit v1.2.3