[RESOLVED] Why is it recommended to clone a theme as a submodule when using Netlify?

I’m following Use Hugo Themes with Netlify.

If I’m not mistaken, cloning the theme as a submodule would make a website vulnerable to the theme’s latest changes. For example, if an update has a bug in it. Would it not be better to download the theme and add it manually to the themes directory?

Thanks!

1 Like

I would recommend using a submodule. There is a recent thread about it in here.

@digitalcraftsman could you update the docs … I think most people would go want the submodule route.

OK, I read the above wrong: The docs recommends using a submodule, which is good.

So, if you worry about a theme being deleted or similar, you could just copy the theme in or use a git subtree. A Git submodule will handle changes fine, you will lock it to a version and can upgrade if needed/wanted.

In addition to bep’s suggestion I recommend you only to use stable versions of a theme (if it’s versioned) and always check the changelog.

Ah, I didn’t release that the submodule points to a specific commit. Thank you for clearing that up!

That’s a good tip! Is that worth adding to the documentation?

1 Like

I guess you’re not alone. Contributions are always welcome :slight_smile:

1 Like

This query speaks to the confusion of using git with Hugo. It is always great for a project to introduce folks to other free software, but it also means we are gonna need to be more informative about what we are doing, and why. @digitalcraftsman I hope to clarify the docs around this, haven’t figured it out yet.

@developerdavo I don’t like submodule-ing other folks’ repos, so I normally mirror it for my own use, and submodule my copy of the repo. Then I follow the changelog (a lot of themes are on GitHub, so you can put .atom at the end of the releases page URL to get a feed, such as https://github.com/gohugoio/hugo/releases.atom). That works for me! :slight_smile:

1 Like

I guess you’re not alone. Contributions are always welcome :slight_smile:

Just submitted a PR at https://github.com/gohugoio/hugoDocs/pull/251 :smile:

@developerdavo I don’t like submodule-ing other folks’ repos, so I normally mirror it for my own use, and submodule my copy of the repo. Then I follow the changelog (a lot of themes are on GitHub, so you can put .atom at the end of the releases page URL to get a feed, such as https://github.com/gohugoio/hugo/releases.atom1). That works for me! :slight_smile:

That’s a good tip! Thank you