Re-add text above old post content

This commit is contained in:
Oliver Davies 2021-07-01 17:53:07 +01:00
parent 44193cc4a9
commit 76773c4ad8
2 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,12 @@
{% macro shouldDisplayOldPostMessage(post) %}
{% set cutOffDate = 'today -1 year'|date('U') %}
{{ post.date <= cutOffDate }}
{% endmacro %}
{% import _self as helpers %}
{% if helpers.shouldDisplayOldPostMessage(post)|trim %}
<div class="p-6 my-10 border border-gray-300 dark:bg-gray-800 dark:border-gray-700">
<p><strong>Warning:</strong> This post is over a year old. I don't always update old posts with new information, so some of this information may be out of date.</p>
</div>
{% endif %}