Bug: Invalid front matter date with Hugo 0.135.0

My draft posts are all throwing an error below (because lastmod is nil, which is intended as they are draft posts). The error does not occur with v134.3. Reproducible even with new sites (YAML)

ERROR invalid front matter: date: %!!(MISSING)s(<nil>):
---
title: Hi There
date: 2024-09-05
lastmod: 
---

I implemented validation of the four predefined front matter date fields in #12877 to address #10717.

I revised the implementation in #12905 to address #12898 (blank dates).

I neglected to consider that, unlike TOML, YAML and JSON allow null values.

https://github.com/gohugoio/hugo/issues/12906
https://github.com/gohugoio/hugo/pull/12907

This is fixed in the next release, either v0.135.1 or v0.136.0.

2 Likes

I downgraded to 134.3 for now.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.