Skip to content

Commit 9b9ce1f

Browse files
Reimplement announcements (#21586)
* Reimplement announcements Signed-off-by: Celeste Horgan <[email protected]> Address deprecation-warning styling Signed-off-by: Celeste Horgan <[email protected]> Use partial only Signed-off-by: Celeste Horgan <[email protected]> Refine Signed-off-by: Celeste Horgan <[email protected]> * Turn on announcements for preview only Signed-off-by: Celeste Horgan <[email protected]> * Update config.toml Co-authored-by: Celeste Horgan <[email protected]> Co-authored-by: Zach Corleissen <[email protected]>
1 parent 0d766f1 commit 9b9ce1f

File tree

9 files changed

+32
-21
lines changed

9 files changed

+32
-21
lines changed

config.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,9 @@ nextUrl = "https://kubernetes-io-vnext-staging.netlify.com/"
8282
githubWebsiteRepo = "github.com/kubernetes/website"
8383
githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website"
8484

85-
# param for displaying an announcement block on every page; see PR #16210
85+
# param for displaying an announcement block on every page.
86+
# See /i18n/en.toml for message text and title.
8687
announcement = true
87-
# announcement_message is only displayed when announcement = true; update with your specific message
88-
announcement_title = "Black lives matter."
89-
announcement_message_full = "We stand in solidarity with the Black community.<br/>Racism is unacceptable.<br/>It conflicts with the [core values of the Kubernetes project](https://git.k8s.io/community/values.md) and our community does not tolerate it." #appears on homepage. Use md formatting for links and <br/> for line breaks.
90-
announcement_message_compact = "We stand in solidarity with the Black community.<br/>Racism is unacceptable.<br/>It conflicts with the [core values of the Kubernetes project](https://git.k8s.io/community/values.md) and our community does not tolerate it." #appears on subpages
9188
announcement_bg = "#000000" #choose a dark color – text is white
9289

9390
[params.pushAssets]

content/en/_index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
abstract: "Automated container deployment, scaling, and management"
44
cid: home
55
---
6-
{{< deprecationwarning >}}
76

87
{{< blocks/section id="oceanNodes" >}}
98
{{% blocks/feature image="flower" %}}

i18n/en.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# i18n strings for the English (main) site.
22
# NOTE: Please keep the entries in alphabetical order when editing
3+
[announcement_title]
4+
other = "Black lives matter."
5+
6+
[announcement_message]
7+
other = "We stand in solidarity with the Black community.<br/>Racism is unacceptable.<br/> It conflicts with the [core values of the Kubernetes project](https://git.k8s.io/community/values.md) and our community does not tolerate it."
38

49
[caution]
510
other = "Caution:"
@@ -28,6 +33,9 @@ other = "Twitter"
2833
[community_youtube_name]
2934
other = "YouTube"
3035

36+
[deprecation_title]
37+
other = "You are viewing documentation for Kubernetes version:"
38+
3139
[deprecation_warning]
3240
other = " documentation is no longer actively maintained. The version you are currently viewing is a static snapshot. For up-to-date documentation, see the "
3341

layouts/_default/baseof.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ <h5>{{ .Params.abstract }}</h5>
2323
{{ block "hero-more" . }}{{ end }}
2424
</div>
2525
</section>
26-
{{ block "post-hero" . }}{{ end }}
26+
{{ block "post-hero" . }}
27+
{{ block "deprecated" . }}
28+
{{ if .IsHome }}
29+
{{ partial "deprecation-warning.html" . }}
30+
{{ end }}
31+
{{ end }}
32+
{{ end }}
2733
{{ end }}
2834
<main>
2935
<article class="page-content">

layouts/partials/announcement.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<div class="content announcement main-section">
55

66
<h4 class="announcement">
7-
{{ .Page.Param "announcement_title" | markdownify }}
7+
{{ T "announcement_title" | markdownify }}
88
</h4>
9-
<p class="announcement">{{ .Page.Param "announcement_message_compact" | markdownify }}</p>
9+
<p class="announcement">{{ T "announcement_message" | markdownify }}</p>
1010

1111
</div>
1212
</main>
1313
</section>
14-
{{ end }}
14+
{{ end }}

layouts/partials/css.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{{- if .Site.Params.announcement }}
2323
<link rel="stylesheet" href="{{ "css/announcement.css" | relURL }}">
2424
{{- end }}
25-
{{- if .Params.deprecated }}
25+
{{- if .Site.Params.deprecated }}
2626
<link rel="stylesheet" href="{{ "css/deprecation-warning.css" | relURL }}">
2727
{{- end }}
2828
{{- if or (eq .Params.class "gridPage") (eq .Params.class "gridPage gridPageHome") }}
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
{{ if .Param "deprecated" }}
1+
{{ if .Site.Param "deprecated" }}
22
<section id="deprecationWarning">
33
<main>
44
<div class="content deprecation-warning">
55
<h3>
6-
Kubernetes {{ .Param "version" }}
7-
{{ T "deprecation_warning" }}
8-
<a href="{{ site.Params.currentUrl }}">{{ T "latest_version" }}</a>
6+
{{ T "deprecation_title" }} {{ .Param "version" }}
97
</h3>
8+
<p> Kubernetes {{ .Param "version" }} {{ T "deprecation_warning" }}
9+
<a href="{{ site.Params.currentUrl }}">{{ T "latest_version" }}</a>
10+
</p>
1011
</div>
1112
</main>
1213
</section>
13-
{{ end }}
14+
{{ end }}

layouts/partials/frontpage-announcement.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<div class="content announcement main-section">
55

66
<h3>
7-
{{ .Page.Param "announcement_title" | markdownify }}
7+
{{ T "announcement_title" | markdownify }}
88
</h3>
9-
<p>{{ .Page.Param "announcement_message_full" | markdownify }}</p>
9+
<p>{{ T "announcement_message" | markdownify }}</p>
1010

1111
</div>
1212
</main>
1313
</section>
14-
{{ end }}
14+
{{ end }}

static/css/deprecation-warning.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
padding: 20px;
33
margin: 20px 0;
44
border-radius: 3px;
5-
background-color: #eeeeee;
6-
}
5+
background-color: #faf5b6;
6+
}

0 commit comments

Comments
 (0)