From acc9f4cfe7047ec820142651c3c352302b61aaaa Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 11 Jul 2016 11:53:22 -0400 Subject: [PATCH] fix blog posts starting with numbers --- model/Post.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/Post.class.php b/model/Post.class.php index 9f413158..4601c539 100644 --- a/model/Post.class.php +++ b/model/Post.class.php @@ -18,7 +18,7 @@ class Post $category = $pathTokens[count($pathTokens) - 2]; $filename = $pathTokens[count($pathTokens) - 1]; $isRelative = $relativeOrAbsolutePath[0] != '/'; - $slug = static::getSlugFromFilename($filename); + $slug = strpos($filename, '.md') !== false ? static::getSlugFromFilename($filename) : $filename; $path = ($isRelative ? ROOT_DIR . '/posts/' : '') . $relativeOrAbsolutePath . (substr($filename, -3) !== '.md' ? '.md' : '');