# Cascade from \_index.md

**URL:** <https://discourse.gohugo.io/t/cascade-from-index-md/55106>\
**Category:** support\
**Created:** [June 20, 2025, 10:21am UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106 "2025-06-20T10:21:47Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [June 20, 2025, 10:21am UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/1 "2025-06-20T10:21:47Z")

</div>

I have a site that will utilise a similar setup to the one [described here](https://discourse.gohugo.io/t/cascade-title-only-to-one-folder-in-a-branch-bundle/51929). Isn’t there a way to cascade from \_index.md file instead of hugo.toml? Since I would hate to clutter my configuration file with tens or hundreds of these entries.

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [June 20, 2025, 10:49am UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/2 "2025-06-20T10:49:11Z")

</div>

when testing this one [Conditionally hide section of site not working](https://discourse.gohugo.io/t/conditionally-hide-section-of-site-not-working/55065)

i found no problem when cascading from using `_index.md`. **except** if you have a multilingual site. In that case you would have to duplicate the cascades to every languages `_index.html`

you `may switch to a `config` directory which a- as of the docs - could have a separate cascade config file

---

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [June 20, 2025, 11:20am UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/3 "2025-06-20T11:20:44Z")

</div>

> [@irkode](#):
>
> you `may switch to a `config` directory which a- as of the docs - could have a separate cascade config file

I actually tested a `cascade.toml` file in the config directory but it does not work. I am assuming from [the docs](https://gohugo.io/configuration/introduction/#configuration-directory) that such a file is possible?

```auto
[cascade.build]
    list = 'never'
    publishResources = false
    render = 'never'
  [cascade._target]
    path = '{/glossary,/glossary/**}'
    lang = '*'

```

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [June 20, 2025, 11:24am UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/4 "2025-06-20T11:24:59Z")

</div>

shouldn’t you [omit the root key](https://gohugo.io/configuration/introduction/#omit-the-root-key)?

---

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [June 20, 2025, 11:34am UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/5 "2025-06-20T11:34:08Z")

</div>

You are correct, but now another issue arises with toml. For example, I have a build and a params key. Using `_target` throws an error `unmarshal failed: toml: table _target already exists`.

```auto
[build]
    list = 'never'
    publishResources = false
    render = 'never'
  [_target]
    path = '{/glossary,/glossary/**}'
    lang = '*'

[params]
foo = 'bar'
[_target]
path = '/books/fiction/**'

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 20, 2025, 12:47pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/6 "2025-06-20T12:47:31Z")

</div>

You must define cascades in the root config file (e.g., hugo.toml). See:  
[https://github.com/gohugoio/hugo/issues/12899](https://github.com/gohugoio/hugo/issues/12899)

---

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [June 20, 2025, 1:14pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/7 "2025-06-20T13:14:47Z")

</div>

Bummer! And the fact that it is set to unscheduled means it will not be acted upon anytime soon.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 20, 2025, 1:18pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/8 "2025-06-20T13:18:34Z")

</div>

Well, it’s open source…

---

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [June 20, 2025, 1:39pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/9 "2025-06-20T13:39:20Z")

</div>

And the beauty of it is that there are other solutions out there 😁. I will see if I can restructure the site or find another solution out of Hugo.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 20, 2025, 1:43pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/10 "2025-06-20T13:43:17Z")

</div>

Out of curiousity, why can’t you place the `cascade` tables in `config/_default/hugo.toml`?

---

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [June 20, 2025, 1:56pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/11 "2025-06-20T13:56:10Z")

</div>

Will that work with the default hugo.toml in root? If it works, then I will go with that. I just didn’t want to clutter the root one.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 20, 2025, 2:03pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/12 "2025-06-20T14:03:32Z")

</div>

If you are asking, “Does this work?”

```plaintext
project
├── config/
│ └── _default/
│ └── hugo.toml
└── hugo.toml <-- cascade tables here

```

The answer is, “Yes.”

However, I find that confusing.

Getting back to the original problem, why would your file be cluttered? Or to put it another way, why would you need hundreds of `cascade` tables?

---

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [June 20, 2025, 2:23pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/13 "2025-06-20T14:23:56Z")

</div>

> [@jmooring](#):
>
> Or to put it another way, why would you need hundreds of `cascade` tables?

Like in the [link post shared](https://discourse.gohugo.io/t/cascade-title-only-to-one-folder-in-a-branch-bundle/51929), somehow a decision was made at a place I volunteer to group together some content and I presented the multipage posts solution you shared in another post. However, they wanted again to break that content down like in the linked forum post so that similar content share different titles across different folders in the multipage bundle. I tried that trick and it worked, but when we are talking about more than one multilingual posts, those cascades will add up. Hence my concern about cluttering the hugo.toml at root (and back to my first post about using \_index.md to cascade instead).

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 20, 2025, 2:28pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/14 "2025-06-20T14:28:08Z")

</div>

I don’t understand the above, but needing hundreds of cascade values to make it work suggests a design flaw.

---

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [June 20, 2025, 3:12pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/15 "2025-06-20T15:12:35Z")

</div>

My thoughts too. But I cannot find a solution yet. So, for now, Hugo might be limited to what we thought we wanted with this project.

```auto
content/
├── books/
│ ├── fiction/
│ │ ├── book-1.md
│ │ └── book-2.md
│ ├── non-fiction/
│ │ ├── book-3.md
│ │ └── book-4.md
│ └── _index.md
└── _index.md

```

I was thinking of doing this but books becomes a nested section of a section. then other pages will be branch bundles in the same structure. So, `posts/books`, `news/books`, etc.

So, we will only operate with branch bundles as pages, not leaf bundles.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [June 22, 2025, 3:13pm UTC](https://discourse.gohugo.io/t/cascade-from-index-md/55106/16 "2025-06-22T15:13:22Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
