From 483a8ce311ad35e2c18940d1e36b4ecee442debb Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 19 Oct 2024 12:41:53 +0100 Subject: [PATCH] Align deprecation warnings more with Docsy This change helps us prepare the site so we could serve it with near-vanilla Docsy. --- assets/scss/_custom.scss | 43 +++++++++---------------- layouts/_default/baseof.html | 10 +++--- layouts/blog/baseof.html | 3 ++ layouts/blog/list.html | 1 - layouts/blog/single.html | 4 --- layouts/case-studies/list.html | 1 - layouts/case-studies/single-baseof.html | 18 +++++++++++ layouts/docs/baseof.html | 3 ++ layouts/docs/glossary.html | 1 - layouts/docs/list.html | 1 - layouts/docs/release-info.html | 1 - layouts/docs/single.html | 1 - 12 files changed, 45 insertions(+), 42 deletions(-) delete mode 100644 layouts/blog/single.html create mode 100644 layouts/case-studies/single-baseof.html diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss index ec961ec07b..9c93598a0c 100644 --- a/assets/scss/_custom.scss +++ b/assets/scss/_custom.scss @@ -1183,38 +1183,27 @@ body.cid-community #cncf-code-of-conduct h2:after { } } -#caseStudies body > #deprecation-warning, body.cid-casestudies > #deprecation-warning, body.cid-community > #deprecation-warning { - display: inline-block; - vertical-align: top; - position: relative; - background-color: $primary; - color: #fff; +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; + } } -#caseStudies body > #deprecation-warning, body.cid-casestudies > #deprecation-warning { - padding-top: 32px; -} + body.cid-partners { - > #deprecation-warning { - padding: 0; - margin-right: 0; - margin-left: 0; - margin-top: 0; - width: 100vw; - > .content { - width: 100%; - max-width: initial; - margin-right: 0; - margin-left: 0; - margin-top: 0; - padding-left: 5vw; - padding-right: 5vw; - padding-top: 2rem; - padding-bottom: 2rem; - } - } /* SECTIONS */ .section { clear: both; diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 4a82539d10..9fb881d2f9 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -25,15 +25,15 @@ {{ block "post-hero" . }} - {{ block "deprecated" . }} - {{ if or .IsHome ( eq .Params.cid "partners" ) ( eq .Params.cid "community" ) }} - {{ partial "deprecation-warning.html" . }} - {{ end }} - {{ end }} {{ end }} {{ end }}
+ {{ block "deprecation_warning" . }} + {{ if or .IsHome ( eq .Params.cid "partners" ) ( eq .Params.cid "community" ) }} + {{ partial "deprecation-warning.html" . }} + {{ end }} + {{ end }} {{ block "main" . }}{{ end }}
diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html index 3aac0fa0f9..64340ef509 100644 --- a/layouts/blog/baseof.html +++ b/layouts/blog/baseof.html @@ -37,6 +37,9 @@ RSS {{ end -}} + {{ block "deprecation_warning" . }} + {{ partial "deprecation-warning.html" . }} + {{ end }} {{ block "main" . }}{{ end }}
diff --git a/layouts/blog/list.html b/layouts/blog/list.html index fb4084dc47..37d152ef5e 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -12,7 +12,6 @@ have blog posts --> {{ $pageGroups := $pag.PageGroups}} {{ if eq $pag.PageNumber 1 }} {{ end }} -{{ partial "deprecation-warning.html" . }}
{{ range $pageGroups }} diff --git a/layouts/blog/single.html b/layouts/blog/single.html deleted file mode 100644 index 84e2b2265a..0000000000 --- a/layouts/blog/single.html +++ /dev/null @@ -1,4 +0,0 @@ -{{ define "main" }} -{{ partial "deprecation-warning.html" . }} -{{ .Render "content" }} -{{ end }} diff --git a/layouts/case-studies/list.html b/layouts/case-studies/list.html index a2b889683a..f7251a0eb3 100644 --- a/layouts/case-studies/list.html +++ b/layouts/case-studies/list.html @@ -9,7 +9,6 @@ {{ end }} {{ end }} {{ $featured := (where $pages "Params.featured" true).ByWeight | first 4 }} - {{ partial "deprecation-warning.html" . }}

{{ .Title }}

diff --git a/layouts/case-studies/single-baseof.html b/layouts/case-studies/single-baseof.html new file mode 100644 index 0000000000..1d7e2b4996 --- /dev/null +++ b/layouts/case-studies/single-baseof.html @@ -0,0 +1,18 @@ + + + + {{ partial "head.html" . }} + + + {{ partial "navbar.html" . }} + {{ block "deprecation_warning.html" . }} + {{ partial "deprecation-warning.html" . }} + {{ end }} +
+ {{ block "main" . }}{{ end }} +
+ {{ partialCached "footer.html" . }} + {{ partialCached "scripts.html" . }} + + + \ No newline at end of file diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html index ea0b263fb4..503c996e35 100644 --- a/layouts/docs/baseof.html +++ b/layouts/docs/baseof.html @@ -24,6 +24,9 @@
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }} + {{ block "deprecation_warning" . }} + {{ partial "deprecation-warning.html" . }} + {{ end }} {{ block "outdated_content" . }} {{ partial "docs/outdated_content.html" . }} {{ end }} diff --git a/layouts/docs/glossary.html b/layouts/docs/glossary.html index fbff46795f..147870bfa7 100644 --- a/layouts/docs/glossary.html +++ b/layouts/docs/glossary.html @@ -3,7 +3,6 @@ {{ end }} {{ define "main" }} -{{ partial "deprecation-warning.html" . }}

{{ .Title }}

{{ T "layouts_docs_glossary_description" }}

diff --git a/layouts/docs/list.html b/layouts/docs/list.html index 8c1f34b388..cc10537a76 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -6,7 +6,6 @@ {{- end -}} {{- end -}}
- {{- partial "deprecation-warning.html" . -}} {{ $hasContent := false }} {{ with .File }} {{ if ne .Filename "" }} diff --git a/layouts/docs/release-info.html b/layouts/docs/release-info.html index e336673050..60f4f6537d 100644 --- a/layouts/docs/release-info.html +++ b/layouts/docs/release-info.html @@ -2,7 +2,6 @@ {{ if not .Site.Params.deprecated }} {{ .Content }} {{ else }} -{{ partial "deprecation-warning.html" . }}
{{ range where .Site.Pages "Section" "releases" }} {{ if not .IsNode }} diff --git a/layouts/docs/single.html b/layouts/docs/single.html index 08b6c0d90f..6db1b9a0de 100644 --- a/layouts/docs/single.html +++ b/layouts/docs/single.html @@ -1,5 +1,4 @@ {{ define "main" }} -{{ partial "deprecation-warning.html" . }}
{{- if .HasShortcode "kat-button" -}}