2

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?

Nomad
  • 21
  • 4

1 Answers1

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.

runar
  • 2,667
  • 2
  • 15
  • 23
Ferdus
  • 11
  • 1