How to set all md files front matter draft false default ,in config file or other method?

I want to make all my files private default even if draft not set in file front matter part.

But I found just can use build draft false/true.
use global config.yml frontmater:draft does not work.

That’s not possible globally. But you can set cascading frontmatter per section. Markdown files below will take what is defined in the cascade if they have a specific frontmatter not defined.

I tried using @davidsneighbour’s link on cascading and added to my config.toml:

[[cascade]]
draft="true"

However, this seems to render useless the draft="false" already present in some markdown files, and causes none of my files to be published.

I’d rather have my markdown files be whitelisted, meaning I have to set draft="false" or else the file will not be published (including if the file has no frontmatter at all).

Is there still not a way to do this, or am I missing the way to do it using cascading frontmatter?

First, if a section page is marked as draft, then none of the pages within the section will be published.

Second, when you cascade a value down it will not override an existing value.

I think you want to do this in your site configuration, targeting pages not sections.

[[cascade]]
draft = true
[cascade._target]
kind = 'page'
2 Likes