From a4726731edcde42ccc27e084085238c7682f8e7a Mon Sep 17 00:00:00 2001
From: Patrice Chalin
Date: Tue, 1 Feb 2022 14:04:08 -0500
Subject: [PATCH] Mark blogs older than a year as outdated
---
data/i18n/en/en.toml | 8 ++++++++
layouts/partials/deprecation-warning.html | 11 +++++++++++
2 files changed, 19 insertions(+)
diff --git a/data/i18n/en/en.toml b/data/i18n/en/en.toml
index 53467e42de..fd68c17209 100644
--- a/data/i18n/en/en.toml
+++ b/data/i18n/en/en.toml
@@ -202,6 +202,14 @@ other = "Objectives"
[options_heading]
other = "Options"
+[outdated_page_message]
+other = "Kubernetes authors consider this page to be outdated because REASON. We suggest that you use more recent resources."
+[outdated_page_reason]
+other = "it is more than a year old"
+
+[outdated_page_title]
+other = "Outdated page"
+
[post_create_issue]
other = "Create an issue"
diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html
index 14261d73dd..539b9f31ce 100644
--- a/layouts/partials/deprecation-warning.html
+++ b/layouts/partials/deprecation-warning.html
@@ -9,4 +9,15 @@
+{{ else if and (eq .Section "blog") .Date (.Date.Before (now.AddDate -1 0 0)) -}}
+{{ $title := .Param "outdated_page.title" | default (T "outdated_page_title") -}}
+{{ $msg := .Param "outdated_page.message" | default (T "outdated_page_message") -}}
+{{ $reason := .Param "outdated_page.reason" | default (T "outdated_page_reason") -}}
+{{ $msg = replaceRE "REASON" $reason $msg -}}
+
+
+
{{ $title }}
+
{{ $msg }}
+
+
{{ end }}
\ No newline at end of file