Add dynamic copyright year in footer (#121)

This commit is contained in:
Elliot Jordan
2019-04-30 13:09:56 -07:00
committed by Michael Noronha
parent df2dcd00c6
commit 915f2000ff
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ blog = "blog/:slug/"
dateform = "Jan 2, 2006"
dateformfull = "Mon Jan 2 2006 15:04:05 MST"
description = "Example blog"
copyright = "Copyright © 2015 Nishanth Shanmugham"
copyright = "Copyright © 2015-{year} Nishanth Shanmugham"
# copyrightUrl = "https://creativecommons.org/licenses/by-sa/4.0/"
logofile = "img/logo.png"
faviconfile = "img/logo.png"

View File

@@ -16,9 +16,9 @@
{{ if .Site.Params.copyright }}
{{ if .Site.Params.copyrightUrl }}
<a href="{{ .Site.Params.copyrightUrl }}">{{ .Site.Params.copyright }}</a>
<a href="{{ .Site.Params.copyrightUrl }}">{{ replace .Site.Params.copyright "{year}" now.Year }}</a>
{{ else }}
<a href="{{ .Site.BaseURL }}license">{{ .Site.Params.copyright }}</a>
<a href="{{ .Site.BaseURL }}license">{{ replace .Site.Params.copyright "{year}" now.Year }}</a>
{{ end }}
{{ end }}