-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
33 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% if site.outdated_content_warning and page.hide_content_warning != true %} | ||
{% assign content_date = page.last_modified_at | date: "%s" %} | ||
{% if site.outdated_content_warning.ignore_date_updated or page.last_modified_at == nil %} | ||
{% assign content_date = page.date | date: "%s" %} | ||
{% endif %} | ||
|
||
{% assign current_date = "now" | date: "%s" %} | ||
{% assign days_since_last_modified = current_date | minus: content_date | divided_by: 86400 %} | ||
|
||
{% if days_since_last_modified > site.outdated_content_warning.warning_threshold_days %} | ||
{% assign years = days_since_last_modified | divided_by: 365 %} | ||
{% if years > 1 %} | ||
{% assign time_since = "over " | append: years | append: " years ago" %} | ||
{% elsif years == 1 %} | ||
{% assign time_since = "over " | append: years | append: " year ago" %} | ||
{% else %} | ||
{% assign time_since = days_since_last_modified | append: " days ago" %} | ||
{% endif %} | ||
<div class="outdated-warning"> | ||
⚠️ {{ site.outdated_content_warning.warning_text | replace: site.outdated_content_warning.placeholder_text, time_since }} | ||
</div> | ||
{% endif %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters