Add announcement shortcode and partial (#16210)
Add shortcode, partial, and css so we can display an accouncement site-wide. Create a shortcode for use in content/en/ _index.html so announcement is displayed on website landing page. Create a partial for use in layouts/docs/baseof.html so announcement is displaye on every page in '<url>/docs/home' directory. Add two values to config.toml: announcement (boolean) for toggling display of announcement; announcement_message, which is the actual message. Signed-off-by: Aimee Ukasick <aimeeu.opensource@gmail.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
876802d59a
commit
d549942636
@@ -78,6 +78,11 @@ nextUrl = "https://kubernetes-io-vnext-staging.netlify.com/"
|
|||||||
githubWebsiteRepo = "github.com/kubernetes/website"
|
githubWebsiteRepo = "github.com/kubernetes/website"
|
||||||
githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website"
|
githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website"
|
||||||
|
|
||||||
|
# param for displaying an announcement block on every page; see PR #16210
|
||||||
|
announcement = false
|
||||||
|
# announcement_message is only displayed when announcement = true; update with your specific message
|
||||||
|
announcement_message = "The Kubernetes Documentation team would like your feedback! Please take a <a href='https://www.surveymonkey.com/r/8R237FN' target='_blank'>short survey</a> so we can improve the Kubernetes online documentation."
|
||||||
|
|
||||||
[[params.versions]]
|
[[params.versions]]
|
||||||
fullversion = "v1.15.0"
|
fullversion = "v1.15.0"
|
||||||
version = "v1.15"
|
version = "v1.15"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ title: "Production-Grade Container Orchestration"
|
|||||||
abstract: "Automated container deployment, scaling, and management"
|
abstract: "Automated container deployment, scaling, and management"
|
||||||
cid: home
|
cid: home
|
||||||
---
|
---
|
||||||
|
{{< announcement >}}
|
||||||
|
|
||||||
{{< deprecationwarning >}}
|
{{< deprecationwarning >}}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
{{ partial "docs/top-menu.html" . }}
|
{{ partial "docs/top-menu.html" . }}
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ block "announcement" . }}{{ partial "announcement.html" . }}{{ end }}
|
||||||
{{ block "deprecation" . }}{{ partial "deprecation-warning.html" . }}{{ end }}
|
{{ block "deprecation" . }}{{ partial "deprecation-warning.html" . }}{{ end }}
|
||||||
<section id="encyclopedia">
|
<section id="encyclopedia">
|
||||||
{{ block "side-menu" . }}<div id="docsToc" style="display:none;"></div>{{ end }}
|
{{ block "side-menu" . }}<div id="docsToc" style="display:none;"></div>{{ end }}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{{ if .Param "announcement"}}
|
||||||
|
<section id="announcement">
|
||||||
|
<main>
|
||||||
|
<div class="content announcement">
|
||||||
|
<h3>
|
||||||
|
{{ .Param "announcement_message" | markdownify }}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{{ if .Page.Param "announcement" }}
|
||||||
|
<section id="announcement">
|
||||||
|
<main>
|
||||||
|
<div class="content announcement">
|
||||||
|
<h3>
|
||||||
|
{{ .Page.Param "announcement_message" | markdownify }}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
.announcement {
|
||||||
|
padding: 20px;
|
||||||
|
margin: 20px 0;
|
||||||
|
border-radius: 3px;
|
||||||
|
background-color: #eeeeee;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user