Adding "since year" and author support to footer (#245)

* Adding target if statements

* adding Tobias Lindberg to CONTRIBUTORS.md

* adding swedish language i18n file

* adding author to footer

* adjusting swedish translation made in fc7d7f62af52d180486d0074691ab3747fb1da07

* adding since year functionality in footer

* adding since which year if statement to footer

* removing unnecessary lines in footer file

* adjusting footer again a little
This commit is contained in:
Tobias Lindberg 2020-01-05 16:48:31 +01:00 committed by Luiz F. A. de Prá
parent 35a5ce1b77
commit fa59259139
2 changed files with 9 additions and 1 deletions

View File

@ -27,6 +27,7 @@ disqusShortname = "yourdiscussshortname"
hideCredits = false hideCredits = false
hideCopyright = false hideCopyright = false
since = 2019
# Git Commit in Footer, uncomment the line below to enable it. # Git Commit in Footer, uncomment the line below to enable it.
commit = "https://github.com/luizdepra/hugo-coder/tree/" commit = "https://github.com/luizdepra/hugo-coder/tree/"

View File

@ -3,7 +3,14 @@
{{ with .Site.Params.footercontent | safeHTML }} {{ with .Site.Params.footercontent | safeHTML }}
<p>{{.}}</p> <p>{{.}}</p>
{{ end }} {{ end }}
{{ if not .Site.Params.hideCopyright }} © {{ now.Format "2006" }}{{ end }} {{ if not .Site.Params.hideCopyright }}
{{ with .Site.Params.since }}
© {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}
{{ else }}
© {{ now.Year }}
{{ end }}
{{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }}
{{ end }}
{{ if not .Site.Params.hideCredits }} {{ if not .Site.Params.hideCredits }}
{{ if not .Site.Params.hideCopyright }} · {{ end }} {{ 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>. {{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.