Z12.2: `draft` property ignored on sections?

Until it’s possible for me to use sections directly, I’m relying on a section-based structure to emulate page-like behavior for project pages. This mostly comes down to using [extra]-type TOML properties to add context to each project.

For example:

title = "Rosa"
description = "..."
draft = true

template = "projects/project.html"
page_template = "projects/chapter.html"
active = false
status = [ "pre-production", "long-term" ]

logline = "..."

I used to use an [extra] property hidden to explain to the templating engine that this project is not to be rendered. After that – while projects were still page-based – I realized I could use the regular property draft to the same effect, without having to specify additional code to loop over hidden projects.

It appears as though this property is ignored, in one capacity or another, on some (but not all) sections. Even though I’m staring at it in the project’s TOML definition, there’s neither a draft property nor a value to it, true or false, in the resulting loop-based listing:


	"relative_path": "writing/rosa/_index.md", 
	"content": "<p>...</p>\n", 
	"permalink": "", 
	"ancestors": [ 
	"title": "Rosa", 
	"description": "...", 
	"extra": { 
		"active": false, 
		"status": [ 
		"logline": "..." 
	"path": "/writing/rosa/", 
	"components": [ 
	"toc": [], 
	"word_count": 0, 
	"reading_time": 0, 
	"lang": "en", 
	"assets": [], 
	"pages": [], 
	"subsections": [], 
	"translations": []

That’s it. There’s not even a mention of a draft property in the output, even though it’s present in the TOML definition of the project above.

More bizarre is the fact that the property itself only renders on 2 of the 4 projects in the category:

The searched text is highlit only in two JSONized project definitions, even though all four of them have it in the same way. (I’ve checked, twice.) You can see from the search modal in the top right that there are, in fact, two draft definitions present (in the first two projects), but not on the ones below.

My goal is, just like with page-based projects, to filter out sections automatically if they’re described as draft = true. This works for pages, and I don’t see why it shouldn’t work for sections. Work-in-progress categories of content are nothing new.

It would be more acceptable if no section would ever render or use draft; that would be somewhat fair. This kind of selective behavior, I’m not sure how to approach. Could it be on my end? If so, what can I provide to make the case clearer?

This is not implemented yet: https://github.com/getzola/zola/issues/927
I would take a PR for it though.

Wait, so: is it intended that some sections do in fact contain the draft property?

Regarding PR: I’ll see what I can do. Rust seems like a good language to get into.

I’m not sure where the draft is coming from on sections in your example, the code only ever looks at pages for draft.

Feel free to ask for help/advices!