Merge array tables from module into project

We can merge key tables defined in a module into site configuraiton. For example:

[taxonomies]
  _merge = 'deep'

Is there a way to merge array tables defined in a module into site configuration? For example, a module needs several [[cascade]] array tables. I tried merging the [cascade] key table but that didn’t pick up the array tables, or I’m doing it wrong.

Second question… the documentation indicates that, by default, the [module] key table is not merged:

[module]
  _merge = 'none'

But this bit is merged:

[module.hugoVersion]
  extended = true
  min = '0.89.4'

Why?

First of all there is the underscore which indicates (to me) an internal “thingy” that is not handed over. Second I think I might understand you wrong, but having the merge configuration of a module bubble down into your project… wouldn’t that override merge configurations from other modules (or even be chaotic without you knowing which of the modules merge config is ending up being used)?

I did for a while something I like to call “data configuration” for the merging of settings of my modules into the project itself.

  1. create a file in data/namespace/modulename/filename.toml where namespace is something you keep identical over all your projects, modulename is the module. This way you can configure (and override) stuff that does not get overridden again from other modules.
  2. get it via site.Data.namespace.modulename.filename.

Yeah, that one.

A module requires [[cascade]]. I can certainly set that in the project, but wanted to know if I could set in the module, and have it merged up into the project.

1 Like