From 915f2000ffc7a2db7b6d053ac7b626138d3248b1 Mon Sep 17 00:00:00 2001 From: Elliot Jordan Date: Tue, 30 Apr 2019 13:09:56 -0700 Subject: [PATCH] Add dynamic copyright year in footer (#121) --- exampleSite/config.toml | 2 +- layouts/partials/footer.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8b77b2e..9715a05 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -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" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 1d3034e..d1ffdb1 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -16,9 +16,9 @@ {{ if .Site.Params.copyright }} {{ if .Site.Params.copyrightUrl }} - {{ .Site.Params.copyright }} + {{ replace .Site.Params.copyright "{year}" now.Year }} {{ else }} - {{ .Site.Params.copyright }} + {{ replace .Site.Params.copyright "{year}" now.Year }} {{ end }} {{ end }}