From 7e23f0f875ae9afab2ea7cc827b465e9fa881302 Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 8 Aug 2020 16:47:04 +0100 Subject: [PATCH] Tidy & fix deprecation warnings Co-Authored-By: Karen Bradshaw --- assets/scss/_custom.scss | 76 +++++++++++++++++++++++ layouts/_default/baseof.html | 4 +- layouts/blog/baseof.html | 3 + layouts/case-studies/list.html | 1 + layouts/case-studies/single-baseof.html | 1 + layouts/docs/baseof.html | 5 +- layouts/index.headers | 3 - layouts/partials/css.html | 3 - layouts/partials/deprecation-warning.html | 22 +++---- layouts/partials/docs/content-page.html | 2 + static/css/deprecation-warning.css | 6 -- 11 files changed, 99 insertions(+), 27 deletions(-) delete mode 100644 static/css/deprecation-warning.css diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss index 6d353c380c..fbd20d1d88 100644 --- a/assets/scss/_custom.scss +++ b/assets/scss/_custom.scss @@ -284,6 +284,82 @@ blockquote { border-left-color: #d9534f !important; } +.deprecation-warning { + padding: 20px; + margin: 20px 0; + background-color: #faf5b6; + color: #000; +} + +body.td-home .deprecation-warning, body.td-blog .deprecation-warning, body.td-documentation .deprecation-warning { + border-radius: 3px; +} + +body.td-home #deprecation-warning { + max-width: 1000px; + margin-top: 2.5rem; + margin-left: auto; + margin-right: auto; +} + +#caseStudies body > #deprecation-warning, body.cid-casestudies > #deprecation-warning, body.cid-community > #deprecation-warning { + display: inline-block; + vertical-align: top; + position: relative; + background-color: #326ce5; // Kubernetes blue + color: #fff; + padding: 0; + margin: 0; + width: 100vw; +} +#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; +} +body.cid-partners > #deprecation-warning > .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; +} +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; +} + +#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/layouts/_default/baseof.html b/layouts/_default/baseof.html index e85e55e474..612bddbb2c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,7 +3,7 @@ {{ partial "head.html" . }} - +
{{ partial "navbar.html" . }}
@@ -27,7 +27,7 @@ {{ block "post-hero" . }} {{ block "deprecated" . }} - {{ if .IsHome }} + {{ if or .IsHome ( eq .Params.cid "partners" ) ( eq .Params.cid "community" ) }} {{ partial "deprecation-warning.html" . }} {{ end }} {{ end }} diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html index 09099263a5..0e03cce7d5 100644 --- a/layouts/blog/baseof.html +++ b/layouts/blog/baseof.html @@ -27,6 +27,9 @@ {{ partial "blog-sidebar.html" . }}
+ {{ block "deprecated" . }} + {{ partial "deprecation-warning.html" . }} + {{ end }} {{ with .CurrentSection.OutputFormats.Get "rss" -}} RSS diff --git a/layouts/case-studies/list.html b/layouts/case-studies/list.html index deec393953..06dc81d865 100644 --- a/layouts/case-studies/list.html +++ b/layouts/case-studies/list.html @@ -12,6 +12,7 @@
+ {{ partial "deprecation-warning.html" . }}
{{ range $featured }} {{ template "case-study-featured-block" (dict "ctx" $ "page" .) }} diff --git a/layouts/case-studies/single-baseof.html b/layouts/case-studies/single-baseof.html index 64b48a4e13..23b0894543 100644 --- a/layouts/case-studies/single-baseof.html +++ b/layouts/case-studies/single-baseof.html @@ -5,6 +5,7 @@ {{ partial "navbar.html" . }} + {{ partial "deprecation-warning.html" . }} {{ block "main" . }}{{ end }} {{ partialCached "footer.html" . }} diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html index 2b5aea8268..2c25cf1109 100644 --- a/layouts/docs/baseof.html +++ b/layouts/docs/baseof.html @@ -4,7 +4,7 @@ {{ partial "head.html" . }} {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }} - +
{{ partial "navbar.html" . }} {{ partial "announcement.html" . }} @@ -25,6 +25,9 @@
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }} + {{ block "deprecated" . }} + {{ partial "deprecation-warning.html" . }} + {{ end }} {{ block "main" . }}{{ end }} {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} {{ partial "feedback.html" .Site.Params.ui.feedback }} diff --git a/layouts/index.headers b/layouts/index.headers index 0308ceac4b..2402097ae6 100644 --- a/layouts/index.headers +++ b/layouts/index.headers @@ -14,9 +14,6 @@ {{- range $pages }} {{- if or (.Params.deprecated) (eq .Params.class "gridPage") (.Params.case_study_styles) (.Params.css) (.Params.js) }} {{ .URL }} - {{- if .Params.deprecated }} - Link: ; rel=preload; as=style - {{- end -}} {{- if eq .Params.class "gridPage" }} Link: ; rel=preload; as=style {{- end -}} diff --git a/layouts/partials/css.html b/layouts/partials/css.html index 64c849c907..c28d682e1f 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -21,9 +21,6 @@ {{- if .Site.Params.announcement }} {{- end }} -{{- if .Site.Params.deprecated }} - -{{- end }} {{- if or (eq .Params.class "gridPage") (eq .Params.class "gridPage gridPageHome") }} diff --git a/layouts/partials/deprecation-warning.html b/layouts/partials/deprecation-warning.html index 60f7121084..6b5bc1f2e2 100644 --- a/layouts/partials/deprecation-warning.html +++ b/layouts/partials/deprecation-warning.html @@ -1,14 +1,12 @@ -{{ if .Site.Param "deprecated" }} -
-
- -
+{{ if (.Site.Param "deprecated") }} +
+
{{ end }} \ No newline at end of file diff --git a/layouts/partials/docs/content-page.html b/layouts/partials/docs/content-page.html index 3aaf803f06..38a1f205cb 100644 --- a/layouts/partials/docs/content-page.html +++ b/layouts/partials/docs/content-page.html @@ -1,3 +1,4 @@ +{{ if not (.Site.Param "deprecated") }} {{- $filepath := .page.File.Path }} {{- $editLink := printf "https://github.com/kubernetes/website/edit/master/content/%s/%s" .page.Language.Lang $filepath }}

@@ -5,6 +6,7 @@ Edit This Page

+{{- end -}} {{ if not .page.Params.notitle }}

{{ .page.Title }}

{{ $desc := .page.Description }} diff --git a/static/css/deprecation-warning.css b/static/css/deprecation-warning.css deleted file mode 100644 index caa79d94cd..0000000000 --- a/static/css/deprecation-warning.css +++ /dev/null @@ -1,6 +0,0 @@ -.deprecation-warning { - padding: 20px; - margin: 20px 0; - border-radius: 3px; - background-color: #faf5b6; -} \ No newline at end of file