summaryrefslogtreecommitdiff
path: root/config.php
diff options
context:
space:
mode:
Diffstat (limited to 'config.php')
-rw-r--r--config.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/config.php b/config.php
index 9c8274f..1626ba0 100644
--- a/config.php
+++ b/config.php
@@ -16,16 +16,16 @@ return [
// Default author, if not provided in a post
'author' => 'David T. Sadler',
'sort' => '-date',
- 'path' => '/{filename}',
+ 'path' => '/posts/{date|Y-m-d}/{filename}',
],
- 'categories' => [
- 'path' => '/categories/{filename}',
+ 'tags' => [
+ 'path' => '/tags/{filename}',
'posts' => function ($page, $allPosts) {
return $allPosts->filter(function ($post) use ($page) {
- $categorySlugs = array_map(function ($category) {
- return Str::slug($category);
- }, $post->categories);
- return $post->categories ? in_array($page->getFilename(), $categorySlugs, true) : false;
+ $tagSlugs = array_map(function ($tag) {
+ return Str::slug($tag);
+ }, $post->tags);
+ return $post->tags ? in_array($page->getFilename(), $tagSlugs, true) : false;
});
},
],
@@ -36,7 +36,7 @@ return [
return Datetime::createFromFormat('U', $page->date);
},
- 'allCategories' => function ($page, $allPosts) {
- return $allPosts->pluck('categories')->flatten()->unique();
+ 'allTags' => function ($page, $allPosts) {
+ return $allPosts->pluck('tags')->flatten()->unique()->sort();
},
];