mirror of
https://github.com/privacyguides/privacyguides.org.git
synced 2025-07-02 01:32:41 +00:00
feat(blog): Add old article warning (#2897)
Signed-off-by: fria <138676274+friadev@users.noreply.github.com> Signed-off-by: Daniel Gray <dngray@privacyguides.org>
This commit is contained in:
@ -244,6 +244,26 @@
|
|||||||
|
|
||||||
<!-- Page content -->
|
<!-- Page content -->
|
||||||
<article class="md-content__inner md-typeset">
|
<article class="md-content__inner md-typeset">
|
||||||
|
{% set postyear = page.config.date.created.strftime('%s') | int %}
|
||||||
|
{% set currentyear = build_date_utc.strftime('%s') | int %}
|
||||||
|
{% set difference = (currentyear / 2628000) - (postyear / 2628000) %}
|
||||||
|
{% if difference > 18 %}
|
||||||
|
{% set yearsdifference = ((difference - 1) / 12) | int %}
|
||||||
|
<div>
|
||||||
|
<div class="admonition info" style="max-width: 14rem">
|
||||||
|
<p class="admonition-title" title="Some information may no longer be relevant or accurate. We encourage you to conduct your own research to verify if any changes have occurred.">
|
||||||
|
This article is more than {{ yearsdifference }}
|
||||||
|
{% if yearsdifference == 1 %}
|
||||||
|
year
|
||||||
|
{% else %}
|
||||||
|
years
|
||||||
|
{% endif %}
|
||||||
|
old
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% include "partials/content.html" %}
|
{% include "partials/content.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Reference in New Issue
Block a user