I’m already very pleased with the (multiple) cascade with filters feature (Hugo 0.76), to influence build options for certain sections in a documentation website I’m building.
With this small cascade block in the frontmatter of the home page, I can simply drop internal sections from the documentation by putting them in “internal” subfolders, and use draft = “true” in the cascade block:
+++ title = "Home" linkTitle = "Home" [[cascade]] draft = "true" [cascade._target] path = "/**/internal/**" +++
The howto I’m still looking for is how I can influence the draft value with a parameter in the config.toml file, or another smart way to set a different value depending on the environment setting (hugo --environment ).
I tried shortcodes inside the frontmatter, but that area of a content file seems not in scope of shortcodes.
Or is it somehow possible to define cascade constructs outside a content file frontmatter?