I’ve successfully been using Hugo Academic for my professional web page. I use GitHub Desktop to help me upload new files to my Github repository, and then Netlify to publish the site. Everything has worked, and is working as expected.
I hadn’t touched my site in a long while, and when I went into Github Desktop to upload files, I was informed of the following:
“Submodule changes. This is a submoudle based on the repository gcushen/hugo-academic. This submoudle has modified changes. Those changes must be committed inside of the submodule before they can be part of the parent repository.”
But I don’t understand what this is telling me. I infer maybe that upstream the project has changed files? Or perhaps I have changed them? I’m confused.
Github desktop informs me I can open the repository and commit changes to it. When I click “open repository” I see lots of changes to hugo-academic I don’t know anything about and don’t want to mess with (and I’m told on the lower left of the window that I don’t have write access to wowchemy-hugo-themes).
A git submodule is a git repository used within a git repository. You have your own git repository (your site) that uses another repository (the theme) as a submodule.
The submodule (the theme) has changed, either because you have modified the theme files locally, or you have pulled a new version of the theme (if you haven’t touched anything for a while, that’s the more probable cause). To use the newer version of the submodule, you have to commit a change in your main repo: add the themes/ file to a git commit and push it.
Are submodules required to use themes in Hugo? I’d rather have nothing to do with them; we have them at $DAYJOB and I hate them, precisely as told here:
In my short first trip into Hugo (guided by the Quick Start document) I was able to do without a submodule by checking out the theme into a parallel directory and then making a symlink to it. Any obvious severe problems with keeping it that way?
If you are building your site locally, then you can use a symlink if you prefer that IMO. Note that in this case you aren’t tracking which version of the theme you are using, so if you have to re-create your build environment on a different machine for some reason, and the theme repository had some breaking changes compared to the version you are using, your site might not build correctly. Depending on your site and the theme you use, this might be an acceptable risk.
@chicagonyc It sounds like you are more of a casual Hugo user. If that’s the case, do you really have a compelling reason to update the theme? Sometimes a theme update can break other things, and you may not want to spend the time figuring out how to resolve each of the problems.
And it looks like it has been a long time since you last updated the theme, if ever. The repository name in the screen shot is gcushen/hugo-academic, and that repo was moved a long time ago.
I’ve never used GitHub Desktop, so I can’t tell you which buttons to press, but if you agree with my assessment, look for a way to ignore the proposed theme update.
I definitely am a casual Hugo user. I don’t have any reason to update the theme – I thought the cause of the whole situation was that it was updated upstream of me. Perhaps I changed something accidently.
Let’s try another direction: can I just reinitialize a Hugo theme to go back to the status quo ante?
That means someone (either you or someone with access to the same folder) edited the files under themes/academic. As a result, the submodule is now ‘dirty’ (i.e. different from upstream) and this is causing you issues.