Allow to disable the footer with params.footer.enable = false

Default is to have the footer enabled (to keep backwards
compatibility).

The diff looks much worse than it is, I just added a variable and an
if clause, but then had to indent the rest of the file.

Make footerEnabled an explicit variable.

This should improve readability.

Use default parameter for even more readability.
This commit is contained in:
Jøhannes Lippmann 2021-04-28 08:47:23 +02:00
parent 78ea0674dd
commit 674156343d

View file

@ -1,3 +1,6 @@
{{ $footerEnabled := site.Params.footer.enable | default true }}
{{ if $footerEnabled }}
{{ $author:= site.Data.author }} {{ $author:= site.Data.author }}
{{ if (index site.Data site.Language.Lang).author }} {{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index site.Data site.Language.Lang).author }} {{ $author = (index site.Data site.Language.Lang).author }}
@ -110,3 +113,4 @@
</div> </div>
</div> </div>
</footer> </footer>
{{end}}