From fdc81300d3cc93bcb54d3031f4c9c2eff8f22955 Mon Sep 17 00:00:00 2001 From: kyan Date: Sun, 26 Nov 2023 16:10:54 +0000 Subject: [PATCH] Fix post sorting (#4) Fix post sorting. - sort posts by name - posts are named by date : 20231126.md Reviewed-on: https://tildegit.org/kyan/tildy/pulls/4 --- main.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cr b/main.cr index 43cce28..e80d42c 100644 --- a/main.cr +++ b/main.cr @@ -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