Say a fairly large project (>1K pages) with one or two dimensions (e.g. languages and versions).
We have a CI/CD workflow that allows to generate temporary previews for each changes made via a Pull/Merge request: a contributor adds or edit some content, then an automatic build and deployment to a sub-directory (e.g. /public/pr-<number>/) are done and linked for review. Once the changes are merged, this sub-directory is removed.
While this works well and allows to inspect the whole project result for any change before it goes into staging or production, it is pretty overkill to build thousands of pages for only a few edited paragraphs, fields or resources here and there.
Is there a way to “construct” dynamically segment configurations to be used on the hugo build --renderSegments <segment> step, without overloading the default project configuration?
Say a script finds the “minimal scope” of the changes (e.g. only in the docs top-section, for the en locale and 2.0 version dimensions), how would one construct the equivalent of
excludes: [{output: "! html"}, {sites: {matrix: {languages: ["! en"]}}}, {sites: {matrix: {versions: ["! 2.0"]}}}, {path: "! {/docs/**}"}] to be used as --renderSegment argument?
Or is it possible to override only some root configuration keys via --config and a temporary configuration merge?
Or maybe --renderSegments could support other combination (e.g. intersection, negation) in addition to the current comma-separated list? But that needs some changes on Hugo side.
What do you think?
TIA