Closed domo84 closed 1 day ago
The idiomatic way to toggle page visibility is by using the draft
front matter field.
Controlling page visibility by setting the publication date to false
was never documented; the fact that it did what you want is a bit of a happy accident.
We're not going to revert the behavior, so you can either:
draft
fieldpublished
field under the params
key and then filter your page collectionsYou can also remove published
from the lists here:
https://gohugo.io/getting-started/configuration/#configure-dates
the fact that it did what you want is a bit of a happy accident.
Oh, I see! Been using it for years on many sites. In fact the GUI we're using for content management also uses it. Using draft
instead from here on seems like the way go.
You can also remove
published
from the lists here:https://gohugo.io/getting-started/configuration/#configure-dates
Awesome!
Thanks for the speedy responses guys!
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
The
published
front matter attribute no longer supportspublished: false
. It results in the following error:As far as I can see this error was introduced in
v0.135.0
when Hugo started enforcing proper date strings. And sincepublished
being an alias ofpublishDate
this is probably an unintended consequence..Expected and previous behavior was that Hugo didn't published the page if it was set to false. A way for editors to toggle page visibility.