ghostwriter
ghostwriter copied to clipboard
Fix build error for Hugo v0.140.2
I have installed the newest version of hugo
hugo version
hugo v0.140.2-aae02ca612a02e085c08366a9c9279f4abb39d94 linux/amd64 BuildDate=2024-12-30T15:01:53Z VendorInfo=gohugoio
And my blog failed to build:
❯ hugo server -D
Start building sites …
hugo v0.140.2-aae02ca612a02e085c08366a9c9279f4abb39d94 linux/amd64 BuildDate=2024-12-30T15:01:53Z VendorInfo=gohugoio
ERROR deprecated: .Site.LastChange was deprecated in Hugo v0.123.0 and will be removed in Hugo 0.141.0. Use .Site.Lastmod instead.
Built in 98 ms
Error: error building site: logged 1 error(s)
Using now.Year seems to be the recommended function now: https://discourse.gohugo.io/t/how-do-i-display-the-current-year/1174/13.
I did write the initial commit in a hurry. But now.Year is displaying the current year, not the year of the last modification.
The proper way to do it seems to be
.Site.Lastmod | time.Format "2006"
I don't know how I can remove the first commit from this pull request.
Thank you, fixed in https://github.com/jbub/ghostwriter/releases/tag/v0.7.0