-
-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with 'Error: date front matter value' when date seems valid? #2635
Comments
Interesting... The YAMLLint value is quoted, the front matter version isn't. Per https://www.11ty.dev/docs/dates/ I think it needs to be a full ISO date that Luxon can parse, like "2015-01-03T22:54:43" |
const { DateTime} = require("luxon")
const res = DateTime.fromISO("2015-01-03 22:54:43 GMT");
console.log({res});
|
Thank you for the details. I'd point out that the yaml provided to YAMLLint wasn't quoted, it only returned it that way. |
https://nodeca.github.io/js-yaml/ is what Eleventy uses under the hood! @pdehaan is right. The date is not a valid YAML date. https://yaml.org/type/timestamp.html Eleventy does have a fallback for these cases, but it isn’t a valid ISO 8601 either 😅 https://moment.github.io/luxon/#/parsing?id=iso-8601 Content dates docs on 11ty: https://www.11ty.dev/docs/dates/ I think your best bet forward here is to upvote and lobby for #867 Thanks! |
Describe the bug
I'm in the process of converting a Jekyll site over to Eleventy. When building I'm getting a ton of 'Error: date front matter value' errors for what appear to be valid datetimes in my front matter.
To Reproduce
Steps to reproduce the behavior:
npx @11ty/eleventy
YAML front matter:
Expected behavior**
Expected the page to build.
Screenshots
![Screen Shot 2022-10-30 at 10 56 54 PM](https://user-images.githubusercontent.com/231390/198941155-18b091e5-a5a9-4357-9176-f3ff3fd62847.png)
YAMLLint seems to think it's valid?
Environment:
eleventy --version
ornpx @11ty/eleventy --version
] 1.0.2Additional context
Example from another YAML parser
The text was updated successfully, but these errors were encountered: