diff options
Diffstat (limited to 'config.production.php')
| -rw-r--r-- | config.production.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/config.production.php b/config.production.php index fd91313..144cac5 100644 --- a/config.production.php +++ b/config.production.php @@ -1,5 +1,6 @@ <?php +use Illuminate\Support\Str; use Carbon\Carbon; $now = Carbon::now(); @@ -20,5 +21,16 @@ return [ return $date ? $date <= $now : false; } ], + 'tags' => [ + 'path' => '/tags/{filename}', + 'posts' => function ($page, $allPosts) { + return $allPosts->filter(function ($post) use ($page) { + $tagSlugs = array_map(function ($tag) { + return Str::slug($tag); + }, $post->tags); + return $post->tags ? in_array($page->getFilename(), $tagSlugs, true) : false; + }); + }, + ], ], ]; |
