From 5a10cb7e6c4c3036b4cc87806a7242d78fdca45d Mon Sep 17 00:00:00 2001
From: Clément Pannetier <35581688+clement-pannetier@users.noreply.github.com>
Date: Thu, 02 Apr 2020 13:12:42 +0000
Subject: [PATCH] feature to fix issue #288 (#289)

---
 exampleSite/config.toml      |    1 +
 layouts/partials/footer.html |   46 ++++++++++++++++++++++++----------------------
 2 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 823c28a..a930053 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -26,6 +26,7 @@
 
     dateformat = "January 2, 2006"
 
+    hideFooter = false
     hideCredits = false
     hideCopyright = false
     since = 2019
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 6c2d72c..b2048ee 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,24 +1,26 @@
-<footer class="footer">
-  <section class="container">
-    {{ with .Site.Params.footercontent | safeHTML }}
-      <p>{{.}}</p>
-    {{ end }}
-    {{ if not .Site.Params.hideCopyright }}
-      {{ with .Site.Params.since }}
-        © {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}
-      {{ else }}
-        © {{ now.Year }}
+{{ if not .Site.Params.hideFooter | default false }}
+  <footer class="footer">
+    <section class="container">
+      {{ with .Site.Params.footercontent | safeHTML }}
+        <p>{{ . }}</p>
       {{ end }}
-      {{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }}
-    {{ end }}
-    {{ if not .Site.Params.hideCredits }}
-      {{ if not .Site.Params.hideCopyright }} · {{ end }}
-      {{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
-    {{ end }}
-    {{ if .Site.Params.commit }}
-      {{ if .GitInfo }}
-        [<a href="{{ .Site.Params.commit }}/{{ .GitInfo.Hash }}">{{ .GitInfo.AbbreviatedHash }}</a>]
+      {{ if not .Site.Params.hideCopyright }}
+        ©
+        {{ if (and (.Site.Params.since) (lt .Site.Params.since now.Year)) }}
+          {{ .Site.Params.since }} -
+        {{ end }}
+        {{ now.Year }}
+        {{ with .Site.Params.Author }} {{ . }} {{ end }}
       {{ end }}
-    {{ end }}
-  </section>
-</footer>
+      {{ if not .Site.Params.hideCredits }}
+        {{ if not .Site.Params.hideCopyright }} · {{ end }}
+        {{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
+      {{ end }}
+      {{ if .Site.Params.commit }}
+        {{ if .GitInfo }}
+          [<a href="{{ .Site.Params.commit }}/{{ .GitInfo.Hash }}">{{ .GitInfo.AbbreviatedHash }}</a>]
+        {{ end }}
+      {{ end }}
+    </section>
+  </footer>
+{{ end }}
\ No newline at end of file

--
Gitblit v1.10.0