display current year in footer (#54)
authorAlexander Fallenstedt <a.fallenstedt@gmail.com>
Fri, 31 Dec 2021 03:10:33 +0000 (19:10 -0800)
committerGitHub <noreply@github.com>
Fri, 31 Dec 2021 03:10:33 +0000 (21:10 -0600)
exampleSite/config.yaml
layouts/partials/footer.html

index 657193789b66da89e752ef4a8615c8b08bccff79..59b9ae11445731eaa07be1e967af77cbd8fd41a5 100644 (file)
@@ -30,7 +30,7 @@ menu:
 
 params:
   description: "A website built through Hugo and blogdown."
-  footer: "&copy; [Yihui Xie](https://yihui.org) 2017 -- 2021 | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"
+  footer: "&copy; [Yihui Xie](https://yihui.org) 2017 -- {Year} | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"
 
 markup:
   highlight:
index 3f46ea54770d6fcd34ff70871f75a555365dfe57..f603e172a2458f6f8f0393a468a8515757954962 100644 (file)
@@ -2,7 +2,7 @@
   {{ partial "foot_custom.html" . }}
   {{ with .Site.Params.footer }}
   <hr/>
-  {{ . | markdownify }}
+  {{ replace . "{Year}" now.Year | markdownify}}
   {{ end }}
   </footer>
   </body>