aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2024-12-28 00:00:40 +0100
committerOscar Najera <hi@oscarnajera.com>2024-12-28 00:00:40 +0100
commit2f087466939ea29efb6913f84405aa397c098aa9 (patch)
tree0626895b7bc1acf1752c8196556c3010f1f3e186 /layouts/partials
parentc3165152de86b046f82252885907863e469e1066 (diff)
downloadhugo-minimalist-theme-2f087466939ea29efb6913f84405aa397c098aa9.tar.gz
hugo-minimalist-theme-2f087466939ea29efb6913f84405aa397c098aa9.tar.bz2
hugo-minimalist-theme-2f087466939ea29efb6913f84405aa397c098aa9.zip
Attribution in footer to isolated partial
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/attribution.html61
-rw-r--r--layouts/partials/footer.html62
2 files changed, 62 insertions, 61 deletions
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 @@
+<div class="tc mv3">
+ {{ 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 }}
+ <div
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dct="http://purl.org/dc/terms/"
+ >
+ <span property="dct:title">The content in this website</span>
+ by
+ {{ with .Author.homepage }}
+ <a
+ rel="cc:attributionURL dct:creator"
+ property="cc:attributionName"
+ href="{{ . }}"
+ class="link dim"
+ >
+ {{ $.Author.name }}
+ </a>
+ {{ else }}
+ {{ $.Author.name }}
+ {{ end }}
+
+ is licensed under a
+ <a
+ target="_blank"
+ rel="license noopener noreferrer"
+ href="{{ $href }}"
+ class="db dim link"
+ >
+ 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
+ <span class="db ma2">
+ <i class="f2 fab fa-creative-commons"></i>
+ <i class="f2 fab fa-creative-commons-by"></i>
+ {{ with .license }}
+ {{ if in . "by-nc" }}
+ <i class="f2 fab fa-creative-commons-nc"></i>
+ {{ end }}{{ if in . "-nd" }}
+ <i class="f2 fab fa-creative-commons-nd"></i>
+ {{ else if in . "-sa" }}
+ <i class="f2 fab fa-creative-commons-sa"></i>
+ {{ end }}
+ {{ end }}
+ </span>
+ </a>
+ </div>
+ {{ else }}
+ Copyright &copy;
+ {{ now.Format "2006" }}
+ {{ .Author.name }}
+ {{ end }}
+</div>
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 }}
- <div class="tc">
- {{ 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 }}
- <div
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:dct="http://purl.org/dc/terms/"
- >
- <span property="dct:title">The content in this website</span>
- by
- {{ with .Site.Params.Author.homepage }}
- <a
- rel="cc:attributionURL dct:creator"
- property="cc:attributionName"
- href="{{ . }}"
- class="link dim"
- >
- {{ $.Site.Params.Author.name }}
- </a>
- {{ else }}
- {{ $.Site.Params.Author.name }}
- {{ end }}
-
- is licensed under a
- <a
- target="_blank"
- rel="license noopener noreferrer"
- href="{{ $href }}"
- class="db dim link"
- >
- 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
- <span class="db ma2">
- <i class="f2 fab fa-creative-commons"></i>
- <i class="f2 fab fa-creative-commons-by"></i>
- {{ with .Site.Params.license }}
- {{ if in . "by-nc" }}
- <i class="f2 fab fa-creative-commons-nc"></i>
- {{ end }}{{ if in . "-nd" }}
- <i class="f2 fab fa-creative-commons-nd"></i>
- {{ else if in . "-sa" }}
- <i class="f2 fab fa-creative-commons-sa"></i>
- {{ end }}
- {{ end }}
- </span>
- </a>
- </div>
- {{ else }}
- Copyright &copy;
- {{ now.Format "2006" }}
- {{ .Site.Params.Author.name }}
- {{ end }}
- </div>
<div class="tc mv2">
Made in anger with