mirror of https://github.com/luizdepra/hugo-coder.git

Clément Pannetier
02.12.2020 5a10cb7e6c4c3036b4cc87806a7242d78fdca45d
feature to fix issue #288 (#289)

* fix for issue #288

* refactor some conditionnal statements

* adding hideFooter parameter to exampleSite config
2 files modified
13 ■■■■■ changed files
exampleSite/config.toml 1 ●●●● patch | view | raw | blame | history
layouts/partials/footer.html 12 ●●●●● patch | view | raw | blame | history
exampleSite/config.toml
@@ -26,6 +26,7 @@
    dateformat = "January 2, 2006"
    hideFooter = false
    hideCredits = false
    hideCopyright = false
    since = 2019
layouts/partials/footer.html
@@ -1,15 +1,16 @@
{{ if not .Site.Params.hideFooter | default false }}
<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 (and (.Site.Params.since) (lt .Site.Params.since now.Year)) }}
          {{ .Site.Params.since }} -
      {{ end }}
      {{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }}
        {{ now.Year }}
        {{ with .Site.Params.Author }} {{ . }} {{ end }}
    {{ end }}
    {{ if not .Site.Params.hideCredits }}
      {{ if not .Site.Params.hideCopyright }} · {{ end }}
@@ -22,3 +23,4 @@
    {{ end }}
  </section>
</footer>
{{ end }}