Closed wbazant closed 4 years ago
I considered the boolean, but I was imagining a future with more than just those two values for the status
field: pending_approval
for content awaiting approval/review, editing
for content that's in editing, awaiting_approval_from_bob
etc...
Thinking about it now it just feels like I'm creating complexity where it's not needed: If someone wanted a more complex content approval workflow, they could use the data:
hash to do anything they wanted (and I've got a design for a Yancy plugin to do content approval workflows, which would then just need a Statocles configuration). Then the last step of approval would be to remove the draft:
field and publish the site.
So, yeah, that's a good idea. I think Statocles should go the draft: ...
route: It's definitely more user-friendly and easier to remember. That opens us up to that YAML.pm bug, but we could fix that in Yancy::Backend::Static by normalizing booleans to JSON::PP true/false booleans as any other part of Yancy would expect (since usually it gets its input from JSON::Validator). It's the backend's job to make sure what Yancy gets is sane and correct, and so the Static backend could smooth over the issues of loading YAML.
I'll merge this as-is for now, and the change to use a draft
field can come later. Thanks!
I've been thinking about the boolean flag alternative to
status => published|draft
, eg.but
draft: false
translates to{draft => 'false'} in current
YAML.pm` so steering people towards using YAML booleans will expose them to this bug.Posts without a status will be correctly included but produce a warning, until https://github.com/preaction/Yancy/pull/71.