Strategy for updating theme with new versions of Hugo?

This is kind of a broad software engineering question but I realize the answer might depend on specific details like theme’s current code and desired Hugo version jump so I’ll add that in to. I’m 99% sure this has been answered before in the past but I haven’t been able to relocate the thread here, so I apologize about this repeat question.

What is the best strategy for keeping a theme up to date with new releases of Hugo? With my specific example, I want to update my theme that was built with Hugo v0.24.1 to v0.50, which I assume is a fairly big jump.

How can I make sure my theme doesn’t break and is still compatible with newer versions? Would this require pouring through the release notes of every new version since v0.24.1? Can Hugo adequately detect errors if I upgrade Hugo and require the theme to use the latest version (I saw that v0.50 has improved error messages)?

Also if this has been answered before or exists in the docs somewhere, I’d appreciate a link! Thank you!

Not quite possible if you choose to use new important features like Hugo Pipes

Pretty much. Note that there have been a few big releases like Hugo 0.32 with Page Bundles and Hugo 0.43 with Hugo Pipes and other ones. So the answer to your question is yes

Yes the console will tell you exactly what’s wrong with a theme.

But your theme even though it was built with Hugo 0.24.1 has its demo generated on the Hugo Themes website with the latest Hugo 0.51 without ERROR.

When you choose to upgrade your theme make sure to go through the README of the Hugo Themes repository. It has been updated and it contains tips about common issues that might affect a theme demo on the Hugo website.

1 Like

I quickly scanned your theme source, and to me it looks like you should be fine.

What I’m a little bit curious about is this: Why not just download Hugo 0.51 and run it on your example site? If all goes well, hurra! Else, you could post the errors you get as a much better foundation for this topic. Now you’re having us doing lots of guessing.

2 Likes

Thanks for the replies @alexandros and @bep!

Using Hugo Pipes might be one of the reasons I want to update the theme with a newer version of Hugo. When the theme was first developed I built it with an optional way to handle cache busting of CSS and JS assets using Gulp, but it’s much cooler that this can now be done natively with Hugo Pipes. I’ll have to read up more on Page Bundles to understand if I want to implement that new organization of assets.

I suppose if I want to add new features from more recent Hugo versions into the theme that require breaking changes, I could publish the theme with a new major version number.