Reimplement announcements (#21586)

* Reimplement announcements

Signed-off-by: Celeste Horgan <celeste@cncf.io>

Address deprecation-warning styling

Signed-off-by: Celeste Horgan <celeste@cncf.io>

Use partial only

Signed-off-by: Celeste Horgan <celeste@cncf.io>

Refine

Signed-off-by: Celeste Horgan <celeste@cncf.io>

* Turn on announcements for preview only

Signed-off-by: Celeste Horgan <celeste@cncf.io>

* Update config.toml

Co-authored-by: Celeste Horgan <celeste@cncf.io>

Co-authored-by: Zach Corleissen <zacharysarah@users.noreply.github.com>
This commit is contained in:
Celeste Horgan
2020-06-09 13:46:05 -07:00
committed by GitHub
parent 0d766f1400
commit 9b9ce1f942
9 changed files with 32 additions and 21 deletions
+2 -5
View File
@@ -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.<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.
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
announcement_bg = "#000000" #choose a dark color  text is white
[params.pushAssets]
-1
View File
@@ -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" %}}
+8
View File
@@ -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.<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."
[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 "
+7 -1
View File
@@ -23,7 +23,13 @@
{{ block "hero-more" . }}{{ end }}
</div>
</section>
{{ block "post-hero" . }}{{ end }}
{{ block "post-hero" . }}
{{ block "deprecated" . }}
{{ if .IsHome }}
{{ partial "deprecation-warning.html" . }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
<main>
<article class="page-content">
+3 -3
View File
@@ -4,11 +4,11 @@
<div class="content announcement main-section">
<h4 class="announcement">
{{ .Page.Param "announcement_title" | markdownify }}
{{ T "announcement_title" | markdownify }}
</h4>
<p class="announcement">{{ .Page.Param "announcement_message_compact" | markdownify }}</p>
<p class="announcement">{{ T "announcement_message" | markdownify }}</p>
</div>
</main>
</section>
{{ end }}
{{ end }}
+1 -1
View File
@@ -22,7 +22,7 @@
{{- if .Site.Params.announcement }}
<link rel="stylesheet" href="{{ "css/announcement.css" | relURL }}">
{{- end }}
{{- if .Params.deprecated }}
{{- if .Site.Params.deprecated }}
<link rel="stylesheet" href="{{ "css/deprecation-warning.css" | relURL }}">
{{- end }}
{{- if or (eq .Params.class "gridPage") (eq .Params.class "gridPage gridPageHome") }}
+6 -5
View File
@@ -1,13 +1,14 @@
{{ if .Param "deprecated" }}
{{ if .Site.Param "deprecated" }}
<section id="deprecationWarning">
<main>
<div class="content deprecation-warning">
<h3>
Kubernetes {{ .Param "version" }}
{{ T "deprecation_warning" }}
<a href="{{ site.Params.currentUrl }}">{{ T "latest_version" }}</a>
{{ T "deprecation_title" }} {{ .Param "version" }}
</h3>
<p> Kubernetes {{ .Param "version" }} {{ T "deprecation_warning" }}
<a href="{{ site.Params.currentUrl }}">{{ T "latest_version" }}</a>
</p>
</div>
</main>
</section>
{{ end }}
{{ end }}
+3 -3
View File
@@ -4,11 +4,11 @@
<div class="content announcement main-section">
<h3>
{{ .Page.Param "announcement_title" | markdownify }}
{{ T "announcement_title" | markdownify }}
</h3>
<p>{{ .Page.Param "announcement_message_full" | markdownify }}</p>
<p>{{ T "announcement_message" | markdownify }}</p>
</div>
</main>
</section>
{{ end }}
{{ end }}
+2 -2
View File
@@ -2,5 +2,5 @@
padding: 20px;
margin: 20px 0;
border-radius: 3px;
background-color: #eeeeee;
}
background-color: #faf5b6;
}