diff --git a/config.toml b/config.toml index 4acaa66e9530d..2c23e1e9168bc 100644 --- a/config.toml +++ b/config.toml @@ -83,10 +83,12 @@ githubWebsiteRepo = "github.com/kubernetes/website" githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website" # param for displaying an announcement block on every page; see PR #16210 -announcement = false +announcement = true # 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 short survey so we can improve the Kubernetes online documentation." - +announcement_title = "Announcement title here" +announcement_message_full = "Long homepage announcement

Quisque efficitur feugiat neque non accumsan. Sed sed massa pharetra, suscipit mauris ut, viverra felis. Sed id ullamcorper sapien. Vivamus lobortis elementum nunc nec molestie. Ut eleifend tellus diam, in tincidunt purus ullamcorper nec. Morbi quam elit, laoreet at cursus vitae, efficitur condimentum felis. Nam ac felis sed lorem dapibus semper. Integer eu pretium justo. Nunc porta pulvinar ornare. " #appears on homepage. Use md formatting for links and
for line breaks. +announcement_message_compact = "One line compact announcement" #appears on subpages +announcement_bg = "#000000" #choose a dark color – text is white [params.pushAssets] css = [ diff --git a/content/en/_index.html b/content/en/_index.html index f54851f05dbd7..f389669d032fe 100644 --- a/content/en/_index.html +++ b/content/en/_index.html @@ -3,8 +3,6 @@ abstract: "Automated container deployment, scaling, and management" cid: home --- -{{< announcement >}} - {{< deprecationwarning >}} {{< blocks/section id="oceanNodes" >}} @@ -60,4 +58,4 @@

The Challenges of Migrating 150+ Microservices to Kubernetes

{{< blocks/kubernetes-features >}} -{{< blocks/case-studies >}} +{{< blocks/case-studies >}} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d23a1141a3a37..67caf96358fb5 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,6 +4,13 @@ {{ partial "head.html" . }} + {{ block "announcement" . }} + {{ if .IsHome }} + {{ partial "frontpage-announcement.html" . }} + {{ else }} + {{ partial "announcement.html" . }} + {{ end }} + {{ end }} {{ partial "header.html" . }} {{ block "hero" . }} @@ -18,7 +25,6 @@
{{ .Params.abstract }}
{{ block "post-hero" . }}{{ end }} {{ end }} -
{{ block "main" . }}{{ end }} @@ -28,4 +34,4 @@
{{ .Params.abstract }}
{{ partialCached "footer.html" . }} {{ partialCached "footer-scripts.html" . }} - + \ No newline at end of file diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html index c774f688f66e9..c8538f971a7ae 100644 --- a/layouts/blog/baseof.html +++ b/layouts/blog/baseof.html @@ -7,6 +7,7 @@ + {{ partial "announcement.html" . }} {{ partial "header.html" . }}

{{ .Title }}

@@ -39,4 +40,4 @@

{{ .Title }}

{{ partialCached "footer.html" . }} {{ partialCached "footer-scripts.html" . }} - + \ No newline at end of file diff --git a/layouts/community/list.html b/layouts/community/list.html index 27f7c9e382f6c..a9eb9f73ce50e 100644 --- a/layouts/community/list.html +++ b/layouts/community/list.html @@ -1,4 +1,4 @@ {{ define "main" }} {{ .Content }} -{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html index cb3071f5f573f..ab75f412853ad 100644 --- a/layouts/docs/baseof.html +++ b/layouts/docs/baseof.html @@ -4,6 +4,7 @@ {{ partial "head.html" . }} + {{ partial "announcement.html" . }} {{ partial "header.html" . }} {{ block "hero" . }} @@ -11,16 +12,15 @@ {{ partial "docs/top-menu.html" . }}
{{ end }} - {{ block "announcement" . }}{{ partial "announcement.html" . }}{{ end }} {{ block "deprecation" . }}{{ partial "deprecation-warning.html" . }}{{ end }}
{{ block "side-menu" . }}{{ end }}
{{ block "content" . }}{{ end }} - + {{ partial "feedback.html" . }} - + {{ partial "git-info.html" . }}
@@ -45,4 +45,4 @@ })(); - + \ No newline at end of file diff --git a/layouts/partials/announcement.html b/layouts/partials/announcement.html index 33f6f1c86cf44..e1af1f18c8f53 100644 --- a/layouts/partials/announcement.html +++ b/layouts/partials/announcement.html @@ -1,11 +1,14 @@ -{{ if .Param "announcement"}} -
-
-
-

- {{ .Param "announcement_message" | markdownify }} -

-
-
-
-{{ end }} \ No newline at end of file +{{ if .Page.Param "announcement" }} +
+
+
+ +

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

+

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

+ +
+
+
+{{ end }} diff --git a/layouts/partials/css.html b/layouts/partials/css.html index 5b85f9409abcb..20b949497c899 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -19,6 +19,9 @@ +{{- if .Site.Params.announcement }} + +{{- end }} {{- if .Params.deprecated }} {{- end }} @@ -34,4 +37,4 @@ {{- $url := trim . " " | relURL }} {{- end }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/layouts/partials/frontpage-announcement.html b/layouts/partials/frontpage-announcement.html new file mode 100644 index 0000000000000..8cf15f88bd241 --- /dev/null +++ b/layouts/partials/frontpage-announcement.html @@ -0,0 +1,14 @@ +{{ if .Page.Param "announcement" }} +
+
+
+ +

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

+

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

+ +
+
+
+{{ end }} diff --git a/layouts/shortcodes/announcement.html b/layouts/shortcodes/announcement.html index b1b0ef0c2b531..66455dc3470e2 100644 --- a/layouts/shortcodes/announcement.html +++ b/layouts/shortcodes/announcement.html @@ -1,10 +1,13 @@ {{ if .Page.Param "announcement" }} +
-
+
+

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

+
diff --git a/static/css/announcement.css b/static/css/announcement.css index 2819cba501b90..77ba911e5e2d3 100644 --- a/static/css/announcement.css +++ b/static/css/announcement.css @@ -1,6 +1,25 @@ -.announcement { - padding: 20px; - margin: 20px 0; - border-radius: 3px; - background-color: #eeeeee; +.announcement.content { + margin-bottom: 0px; +} + +.announcement > p, .gridPage #announcement .content p, .announcement > h4, .announcement > h3 { + color: #ffffff; +} + +#announcement { + padding-top: 75px; + padding-bottom: 25px; +} + +#hero { + padding-top: 40px; +} + +#fp-announcement { + min-height: 30vh; +} + +#fp-announcement main { + margin-top: 125px; + padding-bottom: 35px; } \ No newline at end of file