sort content correctly

This commit is contained in:
Alex Grintsvayg 2017-03-15 17:32:47 -04:00
parent f9d712e69f
commit f1b57038bd

View file

@ -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;
}