Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/luizdepra/hugo-coder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Pannetier <35581688+clement-pannetier@users.noreply.github.com>2020-04-02 16:12:42 +0300
committerGitHub <noreply@github.com>2020-04-02 16:12:42 +0300
commit5a10cb7e6c4c3036b4cc87806a7242d78fdca45d (patch)
tree65c8b94b814ea0a4382a76f3f6b8077043dde749
parent911a39528b036e8f367cf3741b2842259da4db69 (diff)
feature to fix issue #288 (#289)
* fix for issue #288 * refactor some conditionnal statements * adding hideFooter parameter to exampleSite config
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/footer.html46
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 @@ disqusShortname = "yourdiscussshortname"
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