From 8f144754bc91be7c715d7f21b8ce5becc1058f1c Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 1 Jul 2021 21:47:29 +0100 Subject: [PATCH] Don't show old post message if there's no date --- source/_partials/post/old-post-message.html.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/_partials/post/old-post-message.html.twig b/source/_partials/post/old-post-message.html.twig index 76098da53..6475c5fcf 100644 --- a/source/_partials/post/old-post-message.html.twig +++ b/source/_partials/post/old-post-message.html.twig @@ -1,6 +1,9 @@ {% macro shouldDisplayOldPostMessage(post) %} {% set cutOffDate = 'today -1 year'|date('U') %} - {{ post.date <= cutOffDate }} + + {% if post.date is not empty %} + {{ post.date <= cutOffDate }} + {% endif %} {% endmacro %} {% import _self as helpers %}