Content depth (migrating from Jekyll)

I suspect you have index.md files where you want _index.md files.

Example 1: index.md in root of a/

Content:

content
└── a
    ├── b
    │   ├── c
    │   │   ├── baz.md
    │   │   └── quez.md
    │   ├── bar.md
    │   └── foo.md
    └── index.md

Command:

hugo --disableKinds=RSS,taxonomy,term,sitemap

Rendered pages:

public
├── a
│   └── index.html
└── index.html

Example 2: _index.md in root of a/

Content:

content
└── a
    ├── b
    │   ├── c
    │   │   ├── baz.md
    │   │   └── quez.md
    │   ├── bar.md
    │   └── foo.md
    └── _index.md

Command:

hugo --disableKinds=RSS,taxonomy,term,sitemap

Rendered pages:

public
├── a
│   ├── b
│   │   ├── bar
│   │   │   └── index.html
│   │   ├── c
│   │   │   ├── baz
│   │   │   │   └── index.html
│   │   │   └── quez
│   │   │       └── index.html
│   │   └── foo
│   │       └── index.html
│   └── index.html
└── index.html

Documentation

Explanation

When you place either index.md or _index.md inside of a directory, you’ve told Hugo that the directory is a Page Bundle, of which there are two types:

Branch Bundles:

  • Indicated by presence of _index.md
  • Rendered as a list page using a list.html template
  • There may be additional content further down the branch

Leaf Bundles:

  • Indicated by presence of index.md (no underscore)
  • Rendered as a content page using a single.html template
  • This is the leaf at the end of a branch; content below this file in the directory structure will not be rendered
2 Likes