I'm using hugo theme for my IOS blog and updated the footer copyright information, but every time the website loads it loads the default copyright information from the original theme. How can I update the copyright information?
Asked
Active
Viewed 1,222 times
2
-
Would you be able to show us your website or tell us the name of the theme? – runar Apr 14 '20 at 15:16
-
I think this [link](https://geekthis.net/post/hugo-dynamic-copyright-year/) has the answer! – Ankur Shah May 24 '23 at 13:41
1 Answers
1
Can the copyright message in the footer be enabled to display the current year dynamically?
Change line 9 in layouts/partials/footer_section.html
using a token, such as {currentYear}
that is searched and replaced:
{{ with .Site.Copyright }}{{ . | markdownify}} · {{ end }}
to
{{ with replace .Site.Copyright "{currentYear}" now.Year }}{{ . | markdownify}} · {{ end }}
and have the copyright text display in config/_default/config.toml
display something like:
copyright = "© 2010 - {currentYear} My Name"
The user can choose not to have {currentYear}
in the copyright text or leave it blank.