-
-
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
Accept more readable date-time format in front matter #822
Comments
Alternative approach; the "automatic migration script"On linux, you can use sed -i -e "s/^date: \([0-9\-]\+\) \([0-9\:]\+\) +\([0-9]\+\)/date: \1T\2+\3/g" /path/to/post.md and then, you can use find "$(pwd)" -type f -iname '*.md' -exec sed -i -e "s/^date: \([0-9\-]\+\) \([0-9\:]\+\) +\([0-9]\+\)/date: \1T\2+\3/g" "{}" \; PS: That's if your date value is not quoted like this :
|
Note if it isn’t a string it does the YAML parsing and if it is a string it does Luxon fromISO https://moment.github.io/luxon/#/parsing?id=iso-8601 via https://www.11ty.dev/docs/dates/ Does (sorry for the super late reply!) It does seem unlikely that we’ll add additional date formats for this—sorry! |
Seeing this issue and #867 has me thinking maybe another config hook is needed. Follow along over there! |
Unfortunately, readable datetimes and IANA timezones are not supported: 11ty/eleventy#822
Is your feature request related to a problem? Please describe.
I'm migrating a blog from Hugo to 11ty. The
date:
front-matter fields include timestamp in the format "2019-07-02 22:39:39 +0200" (Hugo accepts it), while 11ty expects iso8601 ("2019-07-02T22:39:39+02:00") in Template.js.While deploying to netlify this is the error message:
Note: There's no difference in the date syntax, therefore this does not affect dates without a timestamp.
Describe the solution you'd like
For easier readability and migration is it possible to accept the following
date:
front-matter format: "2019-07-02 22:39:39 +0200"?Describe alternatives you've considered
date:
front-matter in a site to iso8601. If there is such a script, please inform.Additional context
The text was updated successfully, but these errors were encountered: