I am building my Blog with Hugo, and as you might have found out, I am using the theme PaperMod.
Lately, Hugo has released the version v0.146 (and successively, all the patches up to v0.146.6). They introduced some changes to their template engine in there, so an in-place update was not possible. I would like to write down what I changed to make it work again.
Templates
The new version complained about three things which I fixed one after another:
- The template
_internal/google_analytics.html
failed to load. I didn’t use this template anyways, I just had it commented out in myhead.html
file. Not sure if the comment was the problem; I just removed the line completely and this was fine. - The same thing happened with
partials/templates/twitter_card.html
. I would actually like to get this one back some time in the future, but for now, it’s just gone. - Finally, somwhere in
partials/templates/schema_json.html
, another error occurred. The new line looks like that:{{- $images := partial "templates/_funcs/get-page-images" . -}}
. Before it had a slightly different path.
Caveat: Incorrect post paths
After the compilation went through without problem, I compared the outputs of the two versions, and as it turns out, it broke one of my post paths!
I have published the post /posts/2024/07-acme_sh-wildcard-dns-setup
. Previously, it was called /posts/2024/07-acme.sh-wildcard-dns-setup
; the new version seems to not really allow dots in the filenames any more. The post was kind of lost; instead, an empty file was created in the location /posts/2024/07-acme/index.html
- note that it stopped right at the dot.
Since this hit exactly one of my posts, I decided to do a workaround: I changed the post name. For keeping old links working, I added the following to the post outline (where I add configurations about the post):
aliases:
- /posts/2024/07-acme.sh-wildcard-dns-setup
This one, Hugo allows. Which is good enough for my use case.
And that’s it. No other sites were required for my site.
I will have to update another website soon, where I fear that more things break. Let’s see how that goes…