Skip to content

Commit 4433d23

Browse files
committed
created _archive.scss and added archive check for banner
1 parent 4a7ad67 commit 4433d23

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
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+
}

layouts/_default/baseof.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,10 @@
158158
{{ partial "header.html" . }}
159159

160160
<!-- Archived Documentation Header -->
161-
{{ $archiveVersion := "v1.24" }}
162-
{{ if eq .Section "docs" }}
163-
<div class="archive-warning-banner" role="alert"
164-
style="background-color: #fff3cd; color: #664d03; padding: 1rem; border-bottom: 1px solid #ffecb5; text-align: center;">
165-
<p style="margin-bottom: 0; margin-top: 0;">⚠️ This documentation is for an older version (<strong>{{ .Site.Data.args.version }}</strong>) and is no longer updated.
166-
<a href="/latest{{ .RelPermalink | safeURL }}"
167-
style="font-weight: bold; text-decoration: underline;">Read the latest version</a>.</p>
161+
{{ if and (eq .Section "docs") .Site.Data.args.archive}}
162+
<div class="archive-warning-banner" role="alert">
163+
<p>⚠️ This documentation is for an older version (<strong>{{ .Site.Data.args.version }}</strong>) and is no longer updated.
164+
<a href="/latest{{ .RelPermalink | safeURL }}">Read the latest version</a>.</p>
168165
</div>
169166
{{ end }}
170167

0 commit comments

Comments
 (0)