Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Description
Add new front matter metadata to define the actual event date, and update the sorting logic to order pages by event date, when available.
With this new logic, the Archive page would look something like this:
Has this been requested on Canny?
No
Motivation
The common use case for blogs is to document recent events; in other words, the post date and the event date are more or less the same.
For blogs documenting historical events, the post date remains in the present, as for regular posts, but the event date is in the past, and can be entered as a separate frontMatter string property.
API design
Since some historical events do not have an exact date, this property can be incomplete, without day or even without month, for example:
event_date: '1994'
event_date: '1994-11'
event_date: '1994-11-07'
For events that lasted more than one day, it is possible to also define the end date, as a string with the similar incomplete syntax:
event_end_date: '1995'
event_end_date: '1994-12'
event_end_date: '1994-11-08'
To control this new feature add a sortPostsByEventDate
option; when set to true, the event dates are parsed and used when sorting the posts in the Archive page, so the years of past events are located at the end.
Have you tried building it?
The functionality is implemented in cronica-it@eb1a24e.
Self-service
- I'd be willing to contribute this feature to Docusaurus myself.