Skip to content
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

Post in the latest section are not sorted by date #5

Closed
yabirgb opened this issue Oct 13, 2019 · 1 comment
Closed

Post in the latest section are not sorted by date #5

yabirgb opened this issue Oct 13, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@yabirgb
Copy link
Owner

yabirgb commented Oct 13, 2019

Describe the bug

Post results in the latest section at the index file are not sorted by date

To Reproduce
Steps to reproduce the behavior:

  1. Create a couple of markdown files in the content folder and add a header with at least
Title: Post #i 
Date: 13-04-2019

and change to different dates and titles in each file

  1. Build the site
  2. Order in the latest post section at the index file depends on the names of the files in the content folder and not the date in the headers

Expected behavior
Post should be ordered chronologically

Additional context
To fix this bug the logic on how the post are picked should change. This is done in

https://github.com/yabirgb/arcade/blob/master/arcade/parsing.py#L82

My suggestion would be, since I don't expect to have hundreds and hundreds of posts to use the sorted function of python before doing this. As key for the sorted I would use the date property of the Post class (is a datetime object)

https://github.com/yabirgb/arcade/blob/master/arcade/utils.py#L41

https://docs.python.org/3.5/library/functions.html#sorted

@yabirgb yabirgb added the bug Something isn't working label Oct 13, 2019
@yabirgb
Copy link
Owner Author

yabirgb commented Dec 6, 2019

Closed by efda5d3

@yabirgb yabirgb closed this as completed Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant