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.