diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-28 13:14:33 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-28 13:14:33 +0200 |
| commit | 512e94b28b243105e053c1090f56ac31846bc7cf (patch) | |
| tree | 4558f03558e7e1f9acb3c85194f5d8c7e02f3dc5 /layouts | |
| parent | b40abdfab128f8e5b1f42261c4e8b0cf524370c4 (diff) | |
| download | gohugo-theme-ed-512e94b28b243105e053c1090f56ac31846bc7cf.tar.gz | |
Footer text now is fully optional
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/footer.html | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index fd50c5e..7525a24 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,13 +1,21 @@ -<div class="sidebar-item"> - <p> - {{- with site.Params.footer -}} - {{- $footer_text := replace . "{year}" now.Year -}} - {{- $footer_text = replace $footer_text "©" "©" }} - {{ $footer_text | safeHTML }} - {{- else }}{{- /* TODO: translate strings */ -}} - {{- with .Params.editor }}<p>Edited by {{ . }}, {{ now.Format "2006" }}.</p>{{ end }} - Built with <a href="https://github.com/sergeyklay/gohugo-theme-ed" target="_blank" rel="noopener noreferrer">Ed.</a> - Distributed under an MIT license. - {{- end }} - </p> -</div> +{{ if or site.Params.footer .Params.editor }} + <div class="sidebar-item"> + <p> + {{ with site.Params.footer }} + {{ $footerText := replace . "{year}" now.Year }} + {{ $footerText | safeHTML }} + {{ end }} + {{ with .Params.editor }} + <p> + Edited by {{ . }}, + {{ if not $.Params.Lastmod.IsZero }} + {{ $.Params.Lastmod.Format "2006" }} + {{ else }} + {{ now.Format "2006" }} + {{ end }} + . + </p> + {{ end }} + </p> + </div> +{{ end }} |
