Hugo.toml override for theme

I am using the hugo-noir theme and there is a bug where the theme/hugo-noir/hugo.toml file has theme set to doe-minimalistic. My project’s hugo.toml has the name set correctly. However, I’m using Gitlab Pages to publish my site and the theme is configured as a submodule. When Gitlab builds I am receiving this error:

Error: failed to load modules: module "doe-minimalistic" not found in "/builds/...

It seems to pick up the theme’s hugo.toml instead of the project one. How do I resolve this?

From the sounds of it the submodule seems to be missing. You need to add something like the following into your configuration after the repository was cloned:

    - git submodule sync --recursive
    - git submodule update --init --recursive

After that you should see more errors/warnings if it still doesn’t work. Might have to do with the used URL for the submodule setup (https URL is better than ssh+git) or with rights. The error you posted is the result of everything that came before.

Wait until the upstream issue is fixed?

You already found that issue in the hugo-noir project, would have been nice you added that info here :wink:

So with hugo 92.0 it looks like themes had no inheritance, but nowadays a theme itself may use theme to include some components. That’s why the include of hugo-noir scans for it’s dummy entry doe-minimalistic

as a workaround, just provide the theme by creating an empty file and commit to your repo
/themes/doe-minimalistic/.keep


ps. for local usage the folder would be enough, but git won’t commit empty folders, so there has to be a file inside. file can be named anything you like and does not need any content

1 Like