Beautifulhugo is the Hugo theme I still use today, and a symptom where the last modified date was not displayed showed up, so I dealt with it
Incidentally, the hugo version is 0.80.0
Symptoms
- When I start the server locally, the last modified date is not displayed and the error below appears
$ hugo server -D
....
Failed to get translated string for language "ja" and ID "lastModified": template: :1:22: executing "" at <.Count>: can't evaluate field Count in type string- Since I deploy with Netlify, raising the hugo version in netlify.toml produces the same symptom
...
[context.production.environment]
HUGO_VERSION = "0.80.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"Cause
Looking at the error message, the <.Count> notation seems to be the problem, and it is used in en.yaml, ja.yaml and the like inside beautifulhugo/i18n/.
The symptom appears from Hugo version 0.76 onward
The solution
If you have downloaded or forked the beautifulhugo theme, you can deal with it by removing the Count part of the <.Count> that is used as is in en.yaml and the others.
- translation: "Posted on {{ .Count }}"
+ translation: "Posted on {{ . }}"
- id: lastModified
- translation: "(Last modified on {{ .Count }})"
+ translation: "(Last modified on {{ . }})"
As a submodule
If you manage it as a submodule, placing i18n in the root directory does not get it loaded, so you deal with it by updating the submodule
$ git submodule status
1ff3894b84b1802433b58e22dd22f4eb46a49fa9 themes/beautifulhugo (1ff3894)
$ git submodule update --remote
Submodule path 'themes/beautifulhugo': checked out '99ca240e9977196207da2e09c3804d3e98c14e57'After that, all you have to do is push with git add;git commit -a
With this, raising the hugo version in netlify.toml is fine too.
Of course you also need to git push netlify.toml, so do not forget it!