From 8145093c4b26b64ef146e891eff77bb77dad7a7a Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sun, 10 May 2020 21:32:49 +0100 Subject: Ensure posts are only filtered in production --- config.production.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'config.production.php') 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 @@ '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; + } + ], + ], ]; -- cgit v1.2.3-13-gbd6f