diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss index 132e47aa9a..5930b22f04 100644 --- a/assets/scss/_custom.scss +++ b/assets/scss/_custom.scss @@ -1137,26 +1137,6 @@ body.cid-community #cncf-code-of-conduct h2:after { } } -body.cid-casestudies, body.cid-community, body.cid-partners { - section#deprecation-warning { - padding: 0; - margin: 0; - width: 100%; - - border-top: solid 1em $primary; - border-bottom: solid 1em $primary; - - // Center the pageinfo - padding-left: calc(max(1rem, (100vw - 60rem) / 2)); - padding-right: calc(max(1rem, (100vw - 60rem) / 2)); - } - /* Ensure color overrides */ - section#deprecation-warning, section#deprecation-warning > .pageinfo.deprecation-warning { - background-color: $primary; - color: #fff; - } -} - body.cid-partners { /* SECTIONS */ .section { @@ -1357,16 +1337,6 @@ body.cid-partners { } } } -body.cid-community > #deprecation-warning > .deprecation-warning { - margin-left: 20px; - margin-right: 20px; - color: #faf5b6; - background-color: inherit; -} -body.cid-community > #deprecation-warning > .deprecation-warning > * { - color: inherit; - background-color: inherit; -} body.cid-code-of-conduct main { max-width: calc(min(90vw, 100em)); @@ -1406,22 +1376,6 @@ body.cid-code-of-conduct main { } } -#caseStudies body > #deprecation-warning > .deprecation-warning, body.cid-casestudies > #deprecation-warning > .deprecation-warning { - color: inherit; - background: inherit; - width: 80%; - margin: 0; - margin-top: 120px; - margin-left: auto; - margin-right: auto; - border-radius: initial; -} -#deprecation-warning > .deprecation-warning a { - background: transparent; - color: inherit; - text-decoration: underline; -} - // search & sidebar .td-sidebar { @media only screen and (min-width: 768px) { diff --git a/assets/scss/_k8s_community.scss b/assets/scss/_k8s_community.scss new file mode 100644 index 0000000000..93a4bad6c8 --- /dev/null +++ b/assets/scss/_k8s_community.scss @@ -0,0 +1,5 @@ +body.community .k8s-deprecation-warning { + background-color: $primary; + color: white; + margin: 0; +} \ No newline at end of file diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index fcd1fb2255..8c10fb11f3 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -7,6 +7,7 @@ Add styles or import other files. */ @import "custom"; // Base styles +@import "k8s_community"; @import "k8s_nav"; //Media queries diff --git a/hugo.toml b/hugo.toml index 1bc18705e2..a1d4e780a6 100644 --- a/hugo.toml +++ b/hugo.toml @@ -137,8 +137,9 @@ latest = "v1.32" version = "v1.32" githubbranch = "main" docsbranch = "main" +# Should be changed to Docsy provided `archived_version` in the future. deprecated = false -currentUrl = "https://kubernetes.io/docs/home/" +url_latest_version = "https://kubernetes.io/docs/home/" nextUrl = "https://kubernetes-io-vnext-staging.netlify.com/" # See code_sample shortcode diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 9fb881d2f9..f32ce463d5 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -31,7 +31,7 @@
{{ block "deprecation_warning" . }} {{ if or .IsHome ( eq .Params.cid "partners" ) ( eq .Params.cid "community" ) }} - {{ partial "deprecation-warning.html" . }} + {{ partial "version-banner.html" . }} {{ end }} {{ end }} {{ block "main" . }}{{ end }} diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html index 64340ef509..e18e45acb3 100644 --- a/layouts/blog/baseof.html +++ b/layouts/blog/baseof.html @@ -38,7 +38,7 @@ {{ end -}} {{ block "deprecation_warning" . }} - {{ partial "deprecation-warning.html" . }} + {{ partial "version-banner.html" . }} {{ end }} {{ block "main" . }}{{ end }}
diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html index 503c996e35..093296e471 100644 --- a/layouts/docs/baseof.html +++ b/layouts/docs/baseof.html @@ -25,7 +25,7 @@
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }} {{ block "deprecation_warning" . }} - {{ partial "deprecation-warning.html" . }} + {{ partial "version-banner.html" . }} {{ end }} {{ block "outdated_content" . }} {{ partial "docs/outdated_content.html" . }} diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html deleted file mode 100644 index c730313d01..0000000000 --- a/layouts/partials/deprecation-warning.html +++ /dev/null @@ -1,18 +0,0 @@ -{{ if (.Site.Param "deprecated") }} -
-
-

- {{ T "deprecation_title" }} {{ .Param "version" }} -

-

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

-
-
-{{ else if and (eq .Section "blog") (not .Params.evergreen) .Date (.Date.Before (now.AddDate -1 0 0)) -}} -
-
-

{{ T "outdated_blog__message" }}

-
-
-{{ end }} diff --git a/layouts/partials/version-banner.html b/layouts/partials/version-banner.html new file mode 100644 index 0000000000..1d8e1ecfd2 --- /dev/null +++ b/layouts/partials/version-banner.html @@ -0,0 +1,20 @@ +{{ $color := "primary" }} + + {{ if .Site.Params.deprecated }} {{/* Change the `deprecated` param to Docsy provided `archived_version` param once all use of this param is updated */}} + {{ $latest_version := .Site.Params.url_latest_version }} + {{ $current_version := .Site.Params.version }} +
+ {{ with $current_version }} +

+ {{ T "deprecation_title" }} {{ . | markdownify }} +

+

Kubernetes {{ . | markdownify }} {{ T "deprecation_warning" }} + {{ T "latest_version" }}

+ {{ end }} +
+ {{ else if and (eq .Section "blog") (not .Params.evergreen) .Date (.Date.Before (now.AddDate -1 0 0)) -}} +
+

{{ T "outdated_blog__message" }}

+
+{{ end }}