From a4726731edcde42ccc27e084085238c7682f8e7a Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 1 Feb 2022 14:04:08 -0500 Subject: [PATCH 1/6] 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 From 659dd4b904dce2463edfd1b51079e2b2e89b7db8 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 1 Feb 2022 15:41:54 -0500 Subject: [PATCH 2/6] Add class blog-outdated-warning Co-authored-by: Tim Bannister --- layouts/partials/deprecation-warning.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html index 539b9f31ce..120e651beb 100644 --- a/layouts/partials/deprecation-warning.html +++ b/layouts/partials/deprecation-warning.html @@ -14,7 +14,7 @@ {{ $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 }}

From d7b651a76df212acd82f840eff53a94c3e022ff7 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 1 Feb 2022 15:42:26 -0500 Subject: [PATCH 3/6] page -> article Co-authored-by: Tim Bannister --- data/i18n/en/en.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/i18n/en/en.toml b/data/i18n/en/en.toml index fd68c17209..928d406a92 100644 --- a/data/i18n/en/en.toml +++ b/data/i18n/en/en.toml @@ -208,7 +208,7 @@ other = "Kubernetes authors consider this page to be outdated because REASON. We other = "it is more than a year old" [outdated_page_title] -other = "Outdated page" +other = "Outdated article" [post_create_issue] other = "Create an issue" From 6de4f5bcf167847b11d059b41c1c80052dd447b4 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 1 Feb 2022 15:52:36 -0500 Subject: [PATCH 4/6] Use single i18n entry for the message --- data/i18n/en/en.toml | 8 +++----- layouts/partials/deprecation-warning.html | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/data/i18n/en/en.toml b/data/i18n/en/en.toml index 928d406a92..adb9e00f0b 100644 --- a/data/i18n/en/en.toml +++ b/data/i18n/en/en.toml @@ -202,12 +202,10 @@ 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_blog_over_one_year_old] +other = "The Kubernetes project considers this article to be outdated because it is more than one year old. Check that the information in the page has not become incorrect since its publication." -[outdated_page_title] +[outdated_blog_title] other = "Outdated article" [post_create_issue] diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html index 120e651beb..d6d4f9948f 100644 --- a/layouts/partials/deprecation-warning.html +++ b/layouts/partials/deprecation-warning.html @@ -10,10 +10,8 @@
{{ 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 := .Param "outdated_blog.title" | default (T "outdated_blog_title") -}} +{{ $msg := .Param "outdated_blog.message" | default (T "outdated_blog_over_one_year_old") -}}

{{ $title }}

From 3e8f9d2f152bbcbd2ed8f9d80847b28836fb5c31 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 1 Feb 2022 16:02:38 -0500 Subject: [PATCH 5/6] Whitespace cleanup --- layouts/partials/deprecation-warning.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html index d6d4f9948f..bb34c79bd4 100644 --- a/layouts/partials/deprecation-warning.html +++ b/layouts/partials/deprecation-warning.html @@ -15,7 +15,7 @@

{{ $title }}

-

{{ $msg }}

+

{{ $msg }}

{{ end }} \ No newline at end of file From 1a88ffdf99dc5c01eab567ae7907945d559ea3ba Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 2 Feb 2022 09:04:05 -0500 Subject: [PATCH 6/6] Final cleanup and choice of i18n-key and class names --- data/i18n/en/en.toml | 4 ++-- layouts/partials/deprecation-warning.html | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/data/i18n/en/en.toml b/data/i18n/en/en.toml index adb9e00f0b..ccd6dd35b3 100644 --- a/data/i18n/en/en.toml +++ b/data/i18n/en/en.toml @@ -202,10 +202,10 @@ other = "Objectives" [options_heading] other = "Options" -[outdated_blog_over_one_year_old] +[outdated_blog__message] other = "The Kubernetes project considers this article to be outdated because it is more than one year old. Check that the information in the page has not become incorrect since its publication." -[outdated_blog_title] +[outdated_blog__title] other = "Outdated article" [post_create_issue] diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html index bb34c79bd4..1e72e45cca 100644 --- a/layouts/partials/deprecation-warning.html +++ b/layouts/partials/deprecation-warning.html @@ -10,12 +10,10 @@
{{ else if and (eq .Section "blog") .Date (.Date.Before (now.AddDate -1 0 0)) -}} -{{ $title := .Param "outdated_blog.title" | default (T "outdated_blog_title") -}} -{{ $msg := .Param "outdated_blog.message" | default (T "outdated_blog_over_one_year_old") -}} -
+
-

{{ $title }}

-

{{ $msg }}

+

{{ T "outdated_blog__title" }}

+

{{ T "outdated_blog__message" }}

{{ end }} \ No newline at end of file