diff --git a/_includes/outdated_article_notice.html b/_includes/outdated_article_notice.html new file mode 100644 index 0000000000..147df36e79 --- /dev/null +++ b/_includes/outdated_article_notice.html @@ -0,0 +1,19 @@ +{% unless page.no_outdated_notice %} +{% unless page.categories contains "release" or page.categories contains "pre-release" or page.categories contains "showcase" %} +{% comment %} +`site.outdated_article_threshold` is generated by `_plugins/outdated_article_threshold.rb`. +{% endcomment %} +{% if page.date < site.outdated_article_threshold %} +
+

+ {% if page.outdated_notice_text %} + {{ page.outdated_notice_text }} + {% else %} + This article is from {{ page.date | date: "%B %Y" }}, some of its contents might be outdated and no longer accurate.

+ You can find up-to-date information about the engine in the official documentation. + {% endif %} +

+
+{% endif %} +{% endunless %} +{% endunless %} diff --git a/_layouts/article.html b/_layouts/article.html index 0a09ebe143..4daab83b93 100644 --- a/_layouts/article.html +++ b/_layouts/article.html @@ -136,6 +136,8 @@ layout: default + {% include outdated_article_notice.html %} + {{ content }} diff --git a/_plugins/outdated_article_threshold.rb b/_plugins/outdated_article_threshold.rb new file mode 100644 index 0000000000..4e7caad93d --- /dev/null +++ b/_plugins/outdated_article_threshold.rb @@ -0,0 +1,10 @@ +AVERAGE_SECONDS_PER_MONTH = 2628000 + +# Add a custom `site.outdated_article_threshold` variable. +# We use `site.time` that holds the build time as a base, but since you can't do math in +# the template language we can't use it there directly. +Jekyll::Hooks.register(:site, :after_init) do |site| + # Articles that have a date older than this at build time are considered outdated. + # see `_includes/outdated_article_notice.html` + site.config["outdated_article_threshold"] = site.time - AVERAGE_SECONDS_PER_MONTH * 18 +end diff --git a/assets/css/main.css b/assets/css/main.css index a1973027c2..4a2e0520bd 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -62,6 +62,9 @@ --teams-subteams-color: rgba(255, 255, 255, 0.4); --table-divider-color: rgba(0, 0, 0, 0.1); + + --warning-background-color: #ffedcc; + --warning-color: #404040; } .nav-logo.dark-logo { @@ -132,6 +135,9 @@ --teams-subteams-color: rgba(0, 0, 0, 0.2); --table-divider-color: rgba(255, 255, 255, 0.1); + + --warning-background-color: #444033; + --warning-color: #ffeeaf; } /* Use logo with white text for dark navbar. */ @@ -792,6 +798,11 @@ p.small { background-color: var(--card-footer-color); } +.card-warning { + background: var(--warning-background-color); + color: var(--warning-color); +} + a.card { text-decoration: none; display: flex;