Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ collections:
output: true
permalink: /:collection/:year-:month-:day-:title

expiry_months: 12

feed:
path: atom.xml
collections:
Expand Down
18 changes: 18 additions & 0 deletions _layouts/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
{%- include nav.html -%}

<main id="main">

{% if page.collection == "posts" %}
{% assign page_ts = page.date | date: '%s' %}
{% assign site_ts = site.time | date: '%s' %}
{% assign difference = site_ts | minus: page_ts %}
{% assign expiry_ts = site.expiry_months | times: 2628000 %}
{% if difference > expiry_ts %}

<blockquote>
This post is more than {{ difference | divided_by: 2628000 }} months old. The
contents may no longer be correct. You should check
<a href="/news">newer posts</a> or refer to our
<a href="/guides">guides section</a> to verify details.
</blockquote>

{% endif %}
{% endif %}

{%- include article.html article=page -%}
</main>

Expand Down