Fix post sorting (#4)

Fix post sorting.
- sort posts by name
- posts are named by date : 20231126.md

Reviewed-on: #4
This commit is contained in:
kyan 2023-11-26 16:10:54 +00:00
parent 8483e8b72b
commit fdc81300d3
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ class PostRepository
end
def all : Array(Post)
posts = Dir.glob("#{@config.content_dir}/*.md").map do |file|
posts = Dir.glob("#{@config.content_dir}/*.md").sort.map do |file|
Post.new(file)
end
posts.reverse