Segmentation question

In the setup below, the three external content converters are installed and work fine.

Consider a project with this content structure:

content/
├── _index.md
├── asciidoc.adoc
├── html.html
├── markdown.md
├── org.org
├── pandoc.pdc
└── restructuredtext.rst

And this configuration:

renderSegments = ['main', 'asciidoc', 'pandoc', 'restructuredtext']

[[segments.main.includes]]
  path = '**'

[[segments.main.excludes]]
  path = '{/asciidoc,/pandoc,/restructuredtext}'

[[segments.asciidoc.includes]]
  path = '/asciidoc'

[[segments.pandoc.includes]]
  path = '/pandoc'

[[segments.restructuredtext.includes]]
  path = '/restructuredtext'

[security]
  allowContent = ['.*']
  [security.exec]
    allow = ['^sass$', '^go$', '^git$', '^node$', '^postcss$', '^tailwindcss$', '^asciidoctor$', '^pandoc$', '^rst2html$']

The published site has this structure:

public/
├── html/
│   └── index.html
├── markdown/
│   └── index.html
├── org/
│   └── index.html
├── favicon.ico
└── index.html

I expected to see the other three files, as those paths are “included” in their respective segment definitions.

If I change the configuration to this:

renderSegments = ['asciidoc', 'pandoc', 'restructuredtext']

The published site has this structure:

public/
├── asciidoc/
│   └── index.html
├── pandoc/
│   └── index.html
├── restructuredtext/
│   └── index.html
└── favicon.ico

So the “excludes” in the “main” segment seems to be overriding the “includes” of the other segments. I didn’t expect one segment definition to affect another.

EDIT: The use case above is a poor fit for segmentation; environment-specific build options are a better fit. Having said that, I would still like to understand what happened.

Yea, that’s surprising. Should be fixed in Fix multi --renderSegments merge behavior by bep · Pull Request #15025 · gohugoio/hugo · GitHub

I have some other fixes that needs to get out sooner rather than later, so a patch release is not far away.

You two are in beast mode lately.

I’m just along for the ride, trying to keep up.