diff options
author | Tobias Lindberg <tobias.ehlert@gmail.com> | 2020-01-05 18:48:31 +0300 |
---|---|---|
committer | Luiz F. A. de Prá <luizdepra@users.noreply.github.com> | 2020-01-05 18:48:31 +0300 |
commit | fa59259139e99bf70c9f6645ba9ff89a54e2e7ff (patch) | |
tree | f4402c0f6c01215ddc4993dc81df8c599d1c098d | |
parent | 35a5ce1b775355e74406bc2a6957e5b5c03e1cce (diff) |
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
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/footer.html | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8464276..1d7a284 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -27,6 +27,7 @@ disqusShortname = "yourdiscussshortname" hideCredits = false hideCopyright = false + since = 2019 # Git Commit in Footer, uncomment the line below to enable it. commit = "https://github.com/luizdepra/hugo-coder/tree/" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a5f42df..1677656 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -3,7 +3,14 @@ {{ with .Site.Params.footercontent | safeHTML }} <p>{{.}}</p> {{ 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.hideCopyright }} · {{ end }} {{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>. |