diff options
author | Clément Pannetier <35581688+clement-pannetier@users.noreply.github.com> | 2020-04-02 16:12:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 16:12:42 +0300 |
commit | 5a10cb7e6c4c3036b4cc87806a7242d78fdca45d (patch) | |
tree | 65c8b94b814ea0a4382a76f3f6b8077043dde749 | |
parent | 911a39528b036e8f367cf3741b2842259da4db69 (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.toml | 1 | ||||
-rw-r--r-- | 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 @@ 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 |