Different build options with cascade targets for 0.153 and newer

Hello,

I’m trying to serve different versions of my page distinguished by environment. One specific environment is supposed to have fewer posts in it.

On Hugo 0.152 and older I had this in the front matter of specific posts I didn’t want to appear in the “pubweb” environment:

[[cascade]]
  [cascade.target]
    environment = "pubweb"
  [cascade.build]
    list = "never"
    render = "never"
    publishResources = false

and build it like this:

hugo -e "pubweb" -d "dest-pubweb"

and that worked.

Starting with Hugo 0.153.0 (also tested in 0.156.0 and v0.157.0) that doesn’t work any more, it will render this post anyway.

I’ve read the changelog for 0.153.0 but didn’t really find anything related to this. Version 0.153.4 had some fix with cascade, but as it doesn’t work in 0.157.0 either it doesn’t seem to be related.

Can someone tell me if I missed any changes related to cascade and targets?

I’ve seen different approaches to this goal by using path instead of environment, but as all the posts in question are inside the same directory that doesn’t work here.

I can easily reproduce the behavior. Pages that were not published when building with <= v0.152.2 are published with >= v0.153.0. This is not a good thing.

With this front matter:

[[cascade]]
  [cascade.target]
    environment = "pubweb"
  [cascade.build]
    list = "never"
    render = "never"
    publishResources = false

And this command:

hugo -e pubweb
  cascade from section page cascade from regular page
v0.152.2 section page not published, descendants not published regular page not published
v0.153.0 section page not published, descendants not published regular page published

 
See https://github.com/gohugoio/hugo/issues/14627.

Fixed in v0.158.0, which I suspect will be released within the next week.

2 Likes

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