Documentation Pages
Content Dates #
Setting a Content Date in Front Matter #
Add a date
key to your front matter to override the default date (file creation) and customize how the file is sorted in a collection.
Syntax YAML Front Matter
---
date: 2016-01-01
---
Syntax YAML Front Matter
---
date: Last Modified
---
Valid date
values:
Last Modified
: automatically resolves to the file’s last modified dateCreated
: automatically resolves to the file’s created date (default, this is what is used whendate
is omitted).2016-01-01
or any other valid YAML date value (leaving off the time assumes midnight in UTC, or00:00:00Z
)"2016-01-01"
or any other valid UTC string that Luxon’sDateTime.fromISO
can parse (see also the Luxon API docs).
If a date
key is omitted from the file, the date is assumed to be:
- If the file name has a
YYYY-MM-DD
format (anywhere), this date is used. - File creation date.
Running Eleventy on a Continuous Integration Server? Your collections may appear out of order! See Common Pitfalls.
Are your dates displaying off by one day? You’re probably displaying UTC dates in a local time zone. See Common Pitfalls.