Unexpected behavior (bug?) Cascade/type when frontmatter/draft=true

I’ve had issues using Cascade because my top level non-blog content isn’t under one directory. So I use this:

cascade:

- _target:
    path: "/blog/**"
  type: blog

- _target:
    path: "**"
  type: docs

I haven’t found this kind of first-match strategy in the docs, but it works—except when a blog file has draft: true in its frontmatter. (!) Very odd. I.e.,

When a blog .md file has

draft: false

then the above config works: the blog file is type blog. But when a blog file has

draft: true

then it is incorrectly type docs. I’ve tested it through many edits and restarting the server to track down why the type isn’t respected. And this is what I’ve found. Here are two screenshots, before and after changing draft from true to false. You can see how setting draft: false “fixes” the cascade:

draft: true (wrong type, docs)

draft: false (correct type, blog)

For these examples, I only changed the frontmatter draft: attribute.

What is the code for the sidebar? Also, you write, that you changed only the “draft” attribute, but your screenshots say something about type, wrong and correct. Let us see what is creating the sidebar navigation and we will probably be able to help.

Thanks, but I think the sidebar is a red herring. You can see several other artifacts on the page from the docs type.

I am unable to reproduce the problem as described.

git clone --single-branch -b hugo-forum-topic-49248 https://github.com/jmooring/hugo-testing hugo-forum-topic-49248
cd hugo-forum-topic-49248
hugo server -D