vickonrails/next-starter-peacock

Content does not order chronologically

Closed this issue · 1 comments

Describe the bug
Content (notes, articles, and case studies) does not order by date. It's currently ordered by the filename.

For instance

  • markdown-1.md
  • markdown-2.md

markdown-1 will come first because it comes first in the file system. Ideally, this should be sorted by date of publishing instead.

To Reproduce
Steps to reproduce the behavior:

  1. Add a new file named markdown-3.md to notes.
  2. Make the slug exactly the title (markdown-3.md).
  3. Start the app and go to /notes.
  4. Despite the date specified in the metadata, the order is still determined by the order of the file in the file system.

Expected behavior
The newly added content should show at the topmost position because the date is more recent.

Fixed this issue in this commit