From a49c697da8e83618cfc0be88cc20b231ecc6e311 Mon Sep 17 00:00:00 2001
From: Alexander Bilz <mail@alexbilz.com>
Date: Tue, 25 May 2021 19:13:00 +0000
Subject: [PATCH] Merge pull request #209 from swflint/copyright-string-include-year

---
 layouts/partials/sidebar.html |    2 +-
 README.md                     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 28e7737..68b0678 100644
--- a/README.md
+++ b/README.md
@@ -87,9 +87,9 @@
 Add your own favicon in `static/favicons/favicon.ico`.
 
 ### Copyright
-By default, the copyright will show the authors name followed by the current year, but you can change this by configuring the `copyright` parameter.
+By default, the copyright will show the authors name followed by the current year, but you can change this by configuring the `copyright` parameter.  If this method is used, the string `{{ YEAR }}` will be replaced with the current year during site generation.
 ```toml
-copyright = "2020-2021"
+copyright = "2020-{{ YEAR }}"
 ```
 
 ### Navigation items
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 1c519b5..81e73d8 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -18,6 +18,6 @@
         {{ end }}
     </ul>
     <div class="footer">
-        <div class="by_farbox">&copy; {{ if isset .Site.Params "copyright" }} {{ .Site.Params.copyright | markdownify }} {{ else }} {{ .Site.Params.author }} {{ now.Format "2006"}} {{end}}</div>
+        <div class="by_farbox">&copy; {{ if isset .Site.Params "copyright" }} {{ replace .Site.Params.copyright "{{ YEAR }}" (now.Format "2006") | markdownify }} {{ else }} {{ .Site.Params.author }} {{ now.Format "2006"}} {{end}}</div>
     </div>
 </div>

--
Gitblit v1.10.0