summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2020-05-10 21:32:49 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2020-05-10 21:32:49 +0100
commit8145093c4b26b64ef146e891eff77bb77dad7a7a (patch)
tree4a578a8c9e9f2eec5818825ea192e76c3a0f1420
parent9f417a29afc60336288fc1c9f0f9e176f3d1f431 (diff)
Ensure posts are only filtered in production
-rw-r--r--config.php6
-rw-r--r--config.production.php14
2 files changed, 13 insertions, 7 deletions
diff --git a/config.php b/config.php
index 289ee43..63f47f9 100644
--- a/config.php
+++ b/config.php
@@ -18,13 +18,9 @@ return [
'posts' => [
// Default author, if not provided in a post
'author' => 'David T. Sadler',
+ 'date' => $now->timestamp,
'sort' => '-date',
'path' => '/posts/{date|Y-m-d}/{filename}',
- 'filter' => function ($item) use ($now) {
- // Only publish posts that have a date and which is not in the future.
- $date = $item->getDate();
- return $date ? $date <= $now : false;
- }
],
'tags' => [
'path' => '/tags/{filename}',
diff --git a/config.production.php b/config.production.php
index 85850d9..796ac0f 100644
--- a/config.production.php
+++ b/config.production.php
@@ -1,6 +1,16 @@
<?php
return [
- 'baseUrl' => 'https://davidtsadler.com',
- 'production' => true,
+ 'baseUrl' => 'https://davidtsadler.com',
+ 'production' => true,
+ // Collections
+ 'collections' => [
+ 'posts' => [
+ 'filter' => function ($item) use ($now) {
+ // Only publish posts that have a date and which is not in the future.
+ $date = $item->getDate();
+ return $date ? $date <= $now : false;
+ }
+ ],
+ ],
];