Skip to content

Commit 6783d77

Browse files
authored
Merge pull request #23032 from sftim/20200808_show_deprecation_warning
Tidy & fix deprecation warnings
2 parents 179bd33 + 7e23f0f commit 6783d77

File tree

11 files changed

+99
-27
lines changed

11 files changed

+99
-27
lines changed

assets/scss/_custom.scss

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,82 @@ blockquote {
286286
border-left-color: #d9534f !important;
287287
}
288288

289+
.deprecation-warning {
290+
padding: 20px;
291+
margin: 20px 0;
292+
background-color: #faf5b6;
293+
color: #000;
294+
}
295+
296+
body.td-home .deprecation-warning, body.td-blog .deprecation-warning, body.td-documentation .deprecation-warning {
297+
border-radius: 3px;
298+
}
299+
300+
body.td-home #deprecation-warning {
301+
max-width: 1000px;
302+
margin-top: 2.5rem;
303+
margin-left: auto;
304+
margin-right: auto;
305+
}
306+
307+
#caseStudies body > #deprecation-warning, body.cid-casestudies > #deprecation-warning, body.cid-community > #deprecation-warning {
308+
display: inline-block;
309+
vertical-align: top;
310+
position: relative;
311+
background-color: #326ce5; // Kubernetes blue
312+
color: #fff;
313+
padding: 0;
314+
margin: 0;
315+
width: 100vw;
316+
}
317+
#caseStudies body > #deprecation-warning, body.cid-casestudies > #deprecation-warning {
318+
padding-top: 32px;
319+
}
320+
body.cid-partners > #deprecation-warning {
321+
padding: 0;
322+
margin-right: 0;
323+
margin-left: 0;
324+
margin-top: 0;
325+
width: 100vw;
326+
}
327+
body.cid-partners > #deprecation-warning > .content {
328+
width: 100%;
329+
max-width: initial;
330+
margin-right: 0;
331+
margin-left: 0;
332+
margin-top: 0;
333+
padding-left: 5vw;
334+
padding-right: 5vw;
335+
padding-top: 2rem;
336+
padding-bottom: 2rem;
337+
}
338+
body.cid-community > #deprecation-warning > .deprecation-warning {
339+
margin-left: 20px;
340+
margin-right: 20px;
341+
color: #faf5b6;
342+
background-color: inherit;
343+
}
344+
body.cid-community > #deprecation-warning > .deprecation-warning > * {
345+
color: inherit;
346+
background-color: inherit;
347+
}
348+
349+
#caseStudies body > #deprecation-warning > .deprecation-warning, body.cid-casestudies > #deprecation-warning > .deprecation-warning {
350+
color: inherit;
351+
background: inherit;
352+
width: 80%;
353+
margin: 0;
354+
margin-top: 120px;
355+
margin-left: auto;
356+
margin-right: auto;
357+
border-radius: initial;
358+
}
359+
#deprecation-warning > .deprecation-warning a {
360+
background: transparent;
361+
color: inherit;
362+
text-decoration: underline;
363+
}
364+
289365
// search & sidebar
290366
.td-sidebar {
291367
@media only screen and (min-width: 768px) {

layouts/_default/baseof.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
{{ partial "head.html" . }}
55
</head>
6-
<body class="td-{{ .Kind }}">
6+
<body class="td-{{ .Kind }}{{- if ne .Params.cid "" -}}{{- printf " cid-%s" (lower .Params.cid) -}}{{- end -}}">
77
<header>
88
{{ partial "navbar.html" . }}
99
</header>
@@ -27,7 +27,7 @@ <h5>{{ .Params.abstract }}</h5>
2727
</section>
2828
{{ block "post-hero" . }}
2929
{{ block "deprecated" . }}
30-
{{ if .IsHome }}
30+
{{ if or .IsHome ( eq .Params.cid "partners" ) ( eq .Params.cid "community" ) }}
3131
{{ partial "deprecation-warning.html" . }}
3232
{{ end }}
3333
{{ end }}

layouts/blog/baseof.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ <h1>
2727
{{ partial "blog-sidebar.html" . }}
2828
</div>
2929
<main class="col-12 col-md-9 col-xl-8 pl-md-5 pr-md-4" role="main">
30+
{{ block "deprecated" . }}
31+
{{ partial "deprecation-warning.html" . }}
32+
{{ end }}
3033
{{ with .CurrentSection.OutputFormats.Get "rss" -}}
3134
<a class="btn btn-lg -bg-orange td-rss-button d-none d-lg-block" href="{{ .Permalink | safeURL }}" target="_blank">
3235
RSS <i class="fa fa-rss ml-2 "></i>

layouts/case-studies/list.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<section id="mainContent">
1313
<div class="main-section">
1414
<div class="content">
15+
{{ partial "deprecation-warning.html" . }}
1516
<div class="case-studies">
1617
{{ range $featured }}
1718
{{ template "case-study-featured-block" (dict "ctx" $ "page" .) }}

layouts/case-studies/single-baseof.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
</head>
66
<body>
77
{{ partial "navbar.html" . }}
8+
{{ partial "deprecation-warning.html" . }}
89
{{ block "main" . }}{{ end }}
910
{{ partialCached "footer.html" . }}
1011
<!-- Disabling this as elements queries do not appear to exist on case studies -->

layouts/docs/baseof.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{{ partial "head.html" . }}
55
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
66
</head>
7-
<body class="td-{{ .Kind }}">
7+
<body class="td-{{ .Kind }} td-documentation">
88
<header>
99
{{ partial "navbar.html" . }}
1010
{{ partial "announcement.html" . }}
@@ -25,6 +25,9 @@ <h1>
2525
</div>
2626
<main class="col-12 col-md-9 col-xl-8 pl-md-5" role="main">
2727
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
28+
{{ block "deprecated" . }}
29+
{{ partial "deprecation-warning.html" . }}
30+
{{ end }}
2831
{{ block "main" . }}{{ end }}
2932
{{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }}
3033
{{ partial "feedback.html" .Site.Params.ui.feedback }}

layouts/index.headers

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
{{- range $pages }}
1515
{{- if or (.Params.deprecated) (eq .Params.class "gridPage") (.Params.case_study_styles) (.Params.css) (.Params.js) }}
1616
{{ .URL }}
17-
{{- if .Params.deprecated }}
18-
Link: </css/deprecation-warning.css>; rel=preload; as=style
19-
{{- end -}}
2017
{{- if eq .Params.class "gridPage" }}
2118
Link: </css/gridpage.css>; rel=preload; as=style
2219
{{- end -}}

layouts/partials/css.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
{{- if .Site.Params.announcement }}
2222
<link rel="stylesheet" href="{{ "css/announcement.css" | relURL }}">
2323
{{- end }}
24-
{{- if .Site.Params.deprecated }}
25-
<link rel="stylesheet" href="{{ "css/deprecation-warning.css" | relURL }}">
26-
{{- end }}
2724

2825
{{- if or (eq .Params.class "gridPage") (eq .Params.class "gridPage gridPageHome") }}
2926
<link rel="stylesheet" href="{{ "css/gridpage.css" | relURL }}">
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
{{ if .Site.Param "deprecated" }}
2-
<section id="deprecationWarning">
3-
<main>
4-
<div class="content deprecation-warning">
5-
<h3>
6-
{{ T "deprecation_title" }} {{ .Param "version" }}
7-
</h3>
8-
<p> Kubernetes {{ .Param "version" }} {{ T "deprecation_warning" }}
9-
<a href="{{ site.Params.currentUrl }}">{{ T "latest_version" }}</a>
10-
</p>
11-
</div>
12-
</main>
1+
{{ if (.Site.Param "deprecated") }}
2+
<section id="deprecation-warning">
3+
<div class="content deprecation-warning">
4+
<h3>
5+
{{ T "deprecation_title" }} {{ .Param "version" }}
6+
</h3>
7+
<p> Kubernetes {{ .Param "version" }} {{ T "deprecation_warning" }}
8+
<a href="{{ site.Params.currentUrl }}">{{ T "latest_version" }}</a>
9+
</p>
10+
</div>
1311
</section>
1412
{{ end }}

layouts/partials/docs/content-page.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
{{ if not (.Site.Param "deprecated") }}
12
{{- $filepath := .page.File.Path }}
23
{{- $editLink := printf "https://github.com/kubernetes/website/edit/master/content/%s/%s" .page.Language.Lang $filepath }}
34
<p>
45
<a href="{{ $editLink }}" id="editPageButton" target="_blank" data-proofer-ignore>
56
Edit This Page
67
</a>
78
</p>
9+
{{- end -}}
810
{{ if not .page.Params.notitle }}
911
<h1>{{ .page.Title }}</h1>
1012
{{ $desc := .page.Description }}

0 commit comments

Comments
 (0)