Mark blogs older than a year as outdated

pull/31594/head
Patrice Chalin 2022-02-01 14:04:08 -05:00
parent 05b03c737c
commit a4726731ed
2 changed files with 19 additions and 0 deletions

View File

@ -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"

View File

@ -9,4 +9,15 @@
</p>
</div>
</section>
{{ 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 -}}
<section id="deprecation-warning">
<div class="content deprecation-warning pageinfo">
<h3>{{ $title }}</h3>
<p> {{ $msg }}</p>
</div>
</section>
{{ end }}