Skip to content

Commit f83d4a8

Browse files
sbegin0craigbox
andauthored
Added Out-Of-Date Documentation Header for v1.24 (#16457)
* Added Deprecated Documentation Header Added a warning header to all docs pages warning user that this version is out-of-date with an option to go to /latest * Update banner with craig's comments * created _archive.scss and added archive check for banner * added i18n en for archive banner * added uk and zh for archive header * fix lint --------- Co-authored-by: Craig Box <[email protected]>
1 parent bc6e6d6 commit f83d4a8

File tree

6 files changed

+46
-0
lines changed

6 files changed

+46
-0
lines changed

assets/sass/_all.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
@import "misc/about";
1313
@import "misc/analysis-message";
14+
@import "misc/archive";
1415
@import "misc/article";
1516
@import "misc/banners";
1617
@import "misc/blog";

assets/sass/misc/_archive.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.archive-warning-banner {
2+
background-color: #fff3cd;
3+
color: #664d03;
4+
padding: 1rem;
5+
border-bottom: 1px solid #ffecb5;
6+
text-align: center;
7+
8+
p {
9+
margin-top: 0;
10+
margin-bottom: 0;
11+
}
12+
13+
a {
14+
font-weight: bold;
15+
text-decoration: underline;
16+
color: #413002; // Making link slightly darker than banner text for better contrast/visibility
17+
}
18+
}

i18n/en.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,3 +385,9 @@ other = "Go to solutions"
385385

386386
[case_study_slogan]
387387
other = "Read case studies of companies that benefited from implementing Istio"
388+
389+
[archive_banner_text]
390+
other = "⚠️ This documentation is for an older version (<strong>%s</strong>) and is no longer updated."
391+
392+
[archive_banner_link]
393+
other = "Read the latest version."

i18n/uk.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,9 @@ other = "Перейти до рішень"
386386

387387
[case_study_slogan]
388388
other = "Читайте приклади успішних прикладів використання Istio компаніями, які отримали вигоду від його впровадження"
389+
390+
[archive_banner_text]
391+
other = "⚠️ Це документація для (застарілої) версії (<strong>%s</strong>), яка вже не підтримується."
392+
393+
[archive_banner_link]
394+
other = "Читати останню версію."

i18n/zh.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,9 @@ other = "转到解决方案"
384384

385385
[case_study_slogan]
386386
other = "阅读因实施 Istio 而受益的公司案例"
387+
388+
[archive_banner_text]
389+
other = "⚠️ 此文档针对过时的版本 (<strong>%s</strong>),将不在维护和更新。"
390+
391+
[archive_banner_link]
392+
other = "查看最新文档。"

layouts/_default/baseof.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@
156156

157157
{{ partial "events.html" (dict "page" . "kind" "sticker") }}
158158
{{ partial "header.html" . }}
159+
160+
<!-- Archived Documentation Header -->
161+
{{ if and (eq .Section "docs") .Site.Data.args.archive}}
162+
<div class="archive-warning-banner" role="alert">
163+
{{ (printf (i18n "archive_banner_text") .Site.Data.args.version) | safeHTML }}
164+
<a href="/latest{{ .RelPermalink | safeURL }}">{{ i18n "archive_banner_link" }}</a>
165+
</div>
166+
{{ end }}
167+
159168
{{ partial "events.html" (dict "page" . "kind" "banner") }}
160169

161170
{{ block "main" . }}{{ end }}

0 commit comments

Comments
 (0)