From 9b9ce1f942a4923af119f01a71f85a092e067831 Mon Sep 17 00:00:00 2001 From: Celeste Horgan Date: Tue, 9 Jun 2020 13:46:05 -0700 Subject: [PATCH] Reimplement announcements (#21586) * Reimplement announcements Signed-off-by: Celeste Horgan Address deprecation-warning styling Signed-off-by: Celeste Horgan Use partial only Signed-off-by: Celeste Horgan Refine Signed-off-by: Celeste Horgan * Turn on announcements for preview only Signed-off-by: Celeste Horgan * Update config.toml Co-authored-by: Celeste Horgan Co-authored-by: Zach Corleissen --- config.toml | 7 ++----- content/en/_index.html | 1 - i18n/en.toml | 8 ++++++++ layouts/_default/baseof.html | 8 +++++++- layouts/partials/announcement.html | 6 +++--- layouts/partials/css.html | 2 +- layouts/partials/deprecation-warning.html | 11 ++++++----- layouts/partials/frontpage-announcement.html | 6 +++--- static/css/deprecation-warning.css | 4 ++-- 9 files changed, 32 insertions(+), 21 deletions(-) diff --git a/config.toml b/config.toml index 6b12142868..f7f45f8582 100644 --- a/config.toml +++ b/config.toml @@ -82,12 +82,9 @@ nextUrl = "https://kubernetes-io-vnext-staging.netlify.com/" githubWebsiteRepo = "github.com/kubernetes/website" githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website" -# param for displaying an announcement block on every page; see PR #16210 +# param for displaying an announcement block on every page. +# See /i18n/en.toml for message text and title. announcement = true -# announcement_message is only displayed when announcement = true; update with your specific message -announcement_title = "Black lives matter." -announcement_message_full = "We stand in solidarity with the Black community.
Racism is unacceptable.
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
for line breaks. -announcement_message_compact = "We stand in solidarity with the Black community.
Racism is unacceptable.
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 announcement_bg = "#000000" #choose a dark color – text is white [params.pushAssets] diff --git a/content/en/_index.html b/content/en/_index.html index f389669d03..97e02aa259 100644 --- a/content/en/_index.html +++ b/content/en/_index.html @@ -3,7 +3,6 @@ title: "Production-Grade Container Orchestration" abstract: "Automated container deployment, scaling, and management" cid: home --- -{{< deprecationwarning >}} {{< blocks/section id="oceanNodes" >}} {{% blocks/feature image="flower" %}} diff --git a/i18n/en.toml b/i18n/en.toml index 015897ce78..0c4403604e 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -1,5 +1,10 @@ # i18n strings for the English (main) site. # NOTE: Please keep the entries in alphabetical order when editing +[announcement_title] +other = "Black lives matter." + +[announcement_message] +other = "We stand in solidarity with the Black community.
Racism is unacceptable.
It conflicts with the [core values of the Kubernetes project](https://git.k8s.io/community/values.md) and our community does not tolerate it." [caution] other = "Caution:" @@ -28,6 +33,9 @@ other = "Twitter" [community_youtube_name] other = "YouTube" +[deprecation_title] +other = "You are viewing documentation for Kubernetes version:" + [deprecation_warning] other = " documentation is no longer actively maintained. The version you are currently viewing is a static snapshot. For up-to-date documentation, see the " diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 67caf96358..8d1578b696 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -23,7 +23,13 @@ {{ block "hero-more" . }}{{ end }} - {{ block "post-hero" . }}{{ end }} + {{ block "post-hero" . }} + {{ block "deprecated" . }} + {{ if .IsHome }} + {{ partial "deprecation-warning.html" . }} + {{ end }} + {{ end }} + {{ end }} {{ end }}
diff --git a/layouts/partials/announcement.html b/layouts/partials/announcement.html index e1af1f18c8..cea1eb402e 100644 --- a/layouts/partials/announcement.html +++ b/layouts/partials/announcement.html @@ -4,11 +4,11 @@

- {{ .Page.Param "announcement_title" | markdownify }} + {{ T "announcement_title" | markdownify }}

-

{{ .Page.Param "announcement_message_compact" | markdownify }}

+

{{ T "announcement_message" | markdownify }}

-{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/css.html b/layouts/partials/css.html index 20b949497c..477f656090 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -22,7 +22,7 @@ {{- if .Site.Params.announcement }} {{- end }} -{{- if .Params.deprecated }} +{{- if .Site.Params.deprecated }} {{- end }} {{- if or (eq .Params.class "gridPage") (eq .Params.class "gridPage gridPageHome") }} diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html index e4a5a96043..60f7121084 100644 --- a/layouts/partials/deprecation-warning.html +++ b/layouts/partials/deprecation-warning.html @@ -1,13 +1,14 @@ -{{ if .Param "deprecated" }} +{{ if .Site.Param "deprecated" }}

- Kubernetes {{ .Param "version" }} - {{ T "deprecation_warning" }} - {{ T "latest_version" }} + {{ T "deprecation_title" }} {{ .Param "version" }}

+

Kubernetes {{ .Param "version" }} {{ T "deprecation_warning" }} + {{ T "latest_version" }} +

-{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/frontpage-announcement.html b/layouts/partials/frontpage-announcement.html index 8cf15f88bd..0db8e32805 100644 --- a/layouts/partials/frontpage-announcement.html +++ b/layouts/partials/frontpage-announcement.html @@ -4,11 +4,11 @@

- {{ .Page.Param "announcement_title" | markdownify }} + {{ T "announcement_title" | markdownify }}

-

{{ .Page.Param "announcement_message_full" | markdownify }}

+

{{ T "announcement_message" | markdownify }}

-{{ end }} +{{ end }} \ No newline at end of file diff --git a/static/css/deprecation-warning.css b/static/css/deprecation-warning.css index f7afeffe52..caa79d94cd 100644 --- a/static/css/deprecation-warning.css +++ b/static/css/deprecation-warning.css @@ -2,5 +2,5 @@ padding: 20px; margin: 20px 0; border-radius: 3px; - background-color: #eeeeee; -} + background-color: #faf5b6; +} \ No newline at end of file