← hugo-clarity

Update footer.html to use copyright

dd58b20a937229163ac90246fdc8ace0cb127187 · Iain Henderson · Jan 13, 2023 11:07

If Copyright is set, use that. Otherwise use the site title

Signed-off-by: Iain Henderson <iain.henderson@mac.com>

+3 −3 · 1 file changed

  • layouts/partials/footer.html +3 −3
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index d1bc945..1de15ec 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,5 +1,5 @@
 {{- $s := .Site.Params }}
-{{ $t := .Site.Title }}
+{{- $c := or .Site.Copyright .Site.Title }}
 {{- if or .Params.enableMathNotation $s.enableMathNotation }}
   {{ partialCached "math" . }}
 {{- end }}
@@ -7,8 +7,8 @@
 {{- $defaultFooterLogo := printf "%s%s" $iconsDir "apple-touch-icon.png"}}
 <footer class="footer">
   <div class="footer_inner wrap pale">
-    <img src='{{ absURL (default $defaultFooterLogo $s.footerLogo) }}' class="icon icon_2 transparent" alt="{{ $t }}">
-    <p>{{ T "copyright" | markdownify }}{{ with $s.since }}&nbsp;{{ . }}-{{ end }}&nbsp;<span class="year"></span>&nbsp;{{ upper $t }}. {{ T "all_rights" | markdownify }}</p>
+    <img src='{{ absURL (default $defaultFooterLogo $s.footerLogo) }}' class="icon icon_2 transparent" alt="{{ $c }}">
+    <p>{{ T "copyright" | markdownify }}{{ with $s.since }}&nbsp;{{ . }}-{{ end }}&nbsp;<span class="year"></span>&nbsp;{{ upper $c }}. {{ T "all_rights" | markdownify }}</p>
     {{- partialCached "top" .}}
   </div>
 </footer>