Problems migrating to 0.123.+ (no longer support for multiple content directories)

Hi,

So we are trying to migrate to 0.123.0 (and further). We have been trying to do this a few times before, but it has been difficult. I believe however that i found a reason (hopefully the only reason) why it is not working.

We are using two content directories. One is mounted per project and one is the same for all project (we generate multiple projects using the same base).

So we have the following mount points inside hugo.yaml

module:
  mounts: 
    - source: project-a/content
      target: content
    - source: content
      target: content

Both content directories have the same sections (where the second, generic content has a few more).

We have been using this structure for a while know and it worked fine.

When moving to 0.123.0 it “stops” working. None of the pages from the first content directory (project-a/content) get processed. Removing the second content mount makes that part work again.

I looked at the broken changes list (Some breaking changes planned for Hugo 0.123.0 · Issue #11455 · gohugoio/hugo · GitHub) But was unable to find something.

it is probably important to mention that with the two content mounts we get the following warnings (we don’t get these when using only the first mount):

# Only when using both mounts:

WARN  found no layout file for "html" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN  found no layout file for "html" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

The problems might be deeper, as mentioned we have been trying to migrate a couple of times, every time having to abandon because of time issues.

I am unable to reproduce the problem as described with v0.123.0 and later.

config:

module:
  mounts:
    - source: project-a/content
      target: content
    - source: content
      target: content

structure of project directory:

content/
├── books/
│   ├── book-1.md
│   └── book-2.md
├── films/
│   ├── film-1.md
│   └── film-2.md
└── _index.md
project-a/
└── content/
    └── books/
        ├── book-3.md
        └── book-4.md

published site:

public/
├── books/
│   ├── book-1/
│   │   └── index.html
│   ├── book-2/
│   │   └── index.html
│   ├── book-3/         <-- from project-a/content
│   │   └── index.html
│   ├── book-4/         <-- from project-a/content
│   │   └── index.html
│   └── index.html
├── films/
│   ├── film-1/
│   │   └── index.html
│   ├── film-2/
│   │   └── index.html
│   └── index.html
├── favicon.ico
└── index.html

test site

git clone --single-branch -b hugo-forum-topic-49050 https://github.com/jmooring/hugo-testing hugo-forum-topic-49050
cd hugo-forum-topic-49050
rm -rf public && hugo && tree public

Thanks for your reply. I used to to slowly build up all the bits and pieces we are using. It turns out a index.html in the shared content dir is the cause of our issue. This worked before 0.123.0

I tried renaming it to _index.html, but it does not result in an index.html in the public folder.

I understand that.

I am trying to determine if this was an intentional breaking change or if we’ve introduced a bug, and to do that I need a reproducible example.

So, in my minimal example above, where do I place an index.html to trigger the problem? And, does the index.html file contain front matter?

I can reproduce something like what you describe by doing this:

content/
├── books/
│   ├── book-1.md
│   └── book-2.md
├── films/
│   ├── film-1.md
│   └── film-2.md
└── _index.md
project-a/
└── content/
    └── books/
        ├── book-3.md
        ├── book-4.md
        └── index.html  

The presence of project-a/content/books/index.html (with or without front matter) makes the union “books” directory a leaf bundle instead of a branch bundle (section), causing none of the book pages to be rendered.

In v0.122.0 and earlier, we treated index.html content files differently depending on whether or not they had front matter. If my example above matches your setup, I suspect that your index.html does not contain front matter.

I have no idea what you are trying to do with the index.html file, but I suspect you should rename it to “_index.html” and create a unique template for this section page.