New config merging loads Bootstrap site config into mine :)

I have the weird case of Bootstraps configuration bleeding through into mine. Since 0.84 introduced deep merging of configurations I found my Params variable polluted (or replaced?) with Bootstraps Hugo parameters configuration.

Hugonewsletter.com loads blocks/bootstrap which loads libraries/bootstrap which imports Bootstrap SCSS and JS itself.

I did not expect to have Bootstraps configuration bleed through because to me it’s only a repo I import and mount. It has no go.mod, but a config.yaml.

What would be the “proper” way to disable this behaviour? I don’t think the shallow/deep-merge applies here. I did the following in my imports:

[[module.imports]]
path = "github.com/twbs/bootstrap"
ignoreConfig = true
ignoreImports = true

which solves the issue of what appears in site.Params, but my content is still missing on the homepage when running hugo server which makes me think that Hugo loads layouts from the Bootstrap repository too.

Note: adding disable = true to the import seems to remove the mounted directories too, so that seems to be no option.

Update: I wonder if this could be construed as a bug in the Bootstrap repository?

I am tagging @xhmikosr because I think they work with Hugo and the Bootstrap project.

I see the config.yml define module mounts within it’s own repo, but not the repo “declaring” itself as a module (via go.mod). Which might be proper use, but somehow I can’t wrap my head around it. Also everything in config.yml seems to be in regards to the Bootstrap website. Wouldn’t a nicer place (less disruptive) be inside of the /site/ folder of the Bootstrap repo?

I can confirm this as well. And it is due to the deep merging of site.Params from bootstrap’s repo. However, adding ignoreConfig: true to my Bootstrap module is working fine for me (I tested by logging site.Params.description to the console).

Apart from this, don’t you think ignoreImports = true is redundant after adding ignoreConfig = true?

I would think so. I’ll test again. It might be one of these “restart the server and it works” cases.

Edit: Oh well, the config is fixed this way, but my front page (index.html) is still empty. I am sure I did something somewhere and checking diff files now. The config issue is solved in regards to the site.Params content. I just can’t pinpoint the empty page yet.

I checked a second and third site that uses the above setup and this answer above is the right one for this specific issue (Github Repo that is imported creates it’s own configuration).

The empty page in the first site is probably something completely different. I should start using verbose commits with real words :laughing:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.