summaryrefslogtreecommitdiff
path: root/config.php
diff options
context:
space:
mode:
Diffstat (limited to 'config.php')
-rw-r--r--config.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/config.php b/config.php
index e357577..9c8274f 100644
--- a/config.php
+++ b/config.php
@@ -22,7 +22,10 @@ return [
'path' => '/categories/{filename}',
'posts' => function ($page, $allPosts) {
return $allPosts->filter(function ($post) use ($page) {
- return $post->categories ? in_array($page->getFilename(), $post->categories, true) : false;
+ $categorySlugs = array_map(function ($category) {
+ return Str::slug($category);
+ }, $post->categories);
+ return $post->categories ? in_array($page->getFilename(), $categorySlugs, true) : false;
});
},
],