Understanding publishDate

I’m just trying to wrap my head around publishDate usage and behavior in Hugo. There seems to be a great deal of misunderstanding or assumptions in my searches and the documentation isn’t always the easiest for me to digest.

In my head, date is the creation date, and adding publishDate is more of an editorial option for pushing content/articles at a specific time/date of your choosing. If no publishDate is present, it would fall back and use date. And that draft = true > publishdate > date.

hugo server -D -F is then required to preview draft and future publish items? Or is that a development vs production environment thing?

And you use the [frontmatter] in the config to define the inheritance/fallback from the defaults?

Welcome to Hugo.

Accurate

I see what you are trying to express here but it’s not quite right. draft is a true/false flag. publishdate communicates something about your post and also won’t publish until the date is past if you have such build parameters, and date is nothing special. Just a date string which can be used or not used for anything or nothing.

These flags can apply to the build or the server.

Yes

1 Like

Quick question, did you mean Hugo will not publish a post even if date is earlier than publishDate?

As far as I understand, Hugo checks if the publishDate is past or future based on the date and time of when you tell it to build or serve your site. It has nothing to do with the date: value .

1 Like

not super sure what you mean by the last statement, or the implications, but it makes sense that if date: is in the future, and you have no publishDate set, and you build your site without building future, then the PublishDate value waterfalls and gets its value from date:

Thanks.

What I meant with draft, would it overrule content that is passed it’s publish date by default? or the are totally independent of each other unless otherwise built to do so?

Draft will overrule any date-based mechanism

1 Like