feature to fix issue #288 (#289)

* fix for issue #288

* refactor some conditionnal statements

* adding hideFooter parameter to exampleSite config
This commit is contained in:
Clément Pannetier
2020-04-02 15:12:42 +02:00
committed by GitHub
parent 911a39528b
commit 5a10cb7e6c
2 changed files with 25 additions and 22 deletions

View File

@@ -26,6 +26,7 @@ disqusShortname = "yourdiscussshortname"
dateformat = "January 2, 2006" dateformat = "January 2, 2006"
hideFooter = false
hideCredits = false hideCredits = false
hideCopyright = false hideCopyright = false
since = 2019 since = 2019

View File

@@ -1,15 +1,16 @@
{{ if not .Site.Params.hideFooter | default false }}
<footer class="footer"> <footer class="footer">
<section class="container"> <section class="container">
{{ with .Site.Params.footercontent | safeHTML }} {{ with .Site.Params.footercontent | safeHTML }}
<p>{{ . }}</p> <p>{{ . }}</p>
{{ end }} {{ end }}
{{ if not .Site.Params.hideCopyright }} {{ if not .Site.Params.hideCopyright }}
{{ with .Site.Params.since }} ©
© {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }} {{ if (and (.Site.Params.since) (lt .Site.Params.since now.Year)) }}
{{ else }} {{ .Site.Params.since }} -
© {{ now.Year }}
{{ end }} {{ end }}
{{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }} {{ now.Year }}
{{ with .Site.Params.Author }} {{ . }} {{ end }}
{{ end }} {{ end }}
{{ if not .Site.Params.hideCredits }} {{ if not .Site.Params.hideCredits }}
{{ if not .Site.Params.hideCopyright }} · {{ end }} {{ if not .Site.Params.hideCopyright }} · {{ end }}
@@ -22,3 +23,4 @@
{{ end }} {{ end }}
</section> </section>
</footer> </footer>
{{ end }}