From f1b57038bd0785463879bc0f1755372be9f30c5e Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Wed, 15 Mar 2017 17:32:47 -0400 Subject: [PATCH] sort content correctly --- model/Post.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/model/Post.class.php b/model/Post.class.php index 4c8b2d60..7c1c106a 100644 --- a/model/Post.class.php +++ b/model/Post.class.php @@ -368,7 +368,9 @@ class Post if (!isset(static::$slugMap[$postType])) { static::$slugMap[$postType] = []; - foreach(glob(ContentActions::CONTENT_DIR . '/' . $postType . '/*.md') as $file) + $files = glob(ContentActions::CONTENT_DIR . '/' . $postType . '/*.md'); + usort($files, 'strnatcasecmp'); + foreach($files as $file) { static::$slugMap[$postType][static::getSlugFromFilename($file)] = $file; }