Cascade bug?

One of my nodes have an _index.md with a front matter in which I’m trying to cascade the featured image. I fail to make it work.

  1. This originally works fine:
---
title: 'xxx'
description: 'yyy'
featured_image: images/logo.png
---
  1. Trying to cascade, this:
---
title: 'xxx'
description: 'yyy'
cascade:
  params:
    featured_image: images/logo.png
---

causes a display bug on my page when my template tries to load children content, for example this :

{{ range (where .Pages "Title" "Présentation") }}
        {{ .Content }}
      {{ end }}

is not rendered, while it was originally.

Am I doing something wrong or is this a bug?
Hugo v0.144.1

If content/posts/_index.md has this front matter…

---
cascade:
  params:
    featured_image: images/logo.png
---

Then all descendants will inherit the featured_image parameter unless it has already been set in the target page or a closer ancestor node.

So your front matter is fine.

But I have no idea what these mean:

  • “display bug”
  • “not rendered”

This means that, among other bits, when my front matter’s got above cascade params, this layout:

<section class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
      {{ range (where .Pages "Title" "Présentation") }}
        {{ .Content }}
      {{ end }}
    </section>

Renders as the following HTML:

<section class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy mid-gray">
</section>

Instead of showing the content it should show.

Based on what you’ve shown us, I cannot correlate the behavior with the front matter.

Please post a link to your project’s Git repository.

See Requesting Help.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.