Open bep opened 3 years ago
Everyone once in a while a user gets burned by "on/off/yes/no" keys. This happened again yesterday. While I understand why this is blocked, I must say I have little sympathy for unqualified dates. If we could start over, or break some eggs, I'd place every unqualified date in Etc/UTC.
Consider replacing github.com/go-yaml/yaml (last updated 2.5 years ago) with github.com/goccy/go-yaml which, at the moment, is actively maintained with 1.2k stars.
What we get:
Eliminates the Norway problem. Booleans are true|True|TRUE|false|False|FALSE. This would be a breaking change for anyone who has been using any of these to represent a boolean value: y|Y|yes|Yes|YES|n|N|no|No|NO|on|On|ON|off|Off|OFF.
Ability to disallow duplicate keys instead of letting the last one win (see #8427).
Helpful error messages:
Error: error building site: process: readAndProcessContent: "/home/jmooring/code/hugo-testing/content/_index.md:43:1": failed to unmarshal YAML: [4:15] unexpected key name
1 | title: home
2 | date: 2024-11-09
3 | params:
> 4 | event_date: 2024-12-31T07:43:15-08:00
5 | foo: bar
The problem we ran into when looking at upgrading to github.com/go-yaml/yaml v3 does not seem to apply here. See https://github.com/go-yaml/yaml/issues/770.
I must say I have little sympathy for unqualified dates.
Just to be clear, this is a very common "unqualified date" (for one, it's very easy to type, which I have sympathy for ...):
publishDate: 2021-07-15
Having the above mean UTC, would create very surprising beheaviour.
Add this to have something to track this with.
The main blocker I see for this is that it's not possible to control location/timezone for dates without that information.
Prints:
Note that
v2
isn't perfect, either, but that at least allows us to handle known dates (e.g. the front matter dates).