feat: replaced the deprecation-warning partial with docsy provided version-banner and customising it
parent
025268bada
commit
804388f903
|
@ -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) {
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
body.community .k8s-deprecation-warning {
|
||||
background-color: $primary;
|
||||
color: white;
|
||||
margin: 0;
|
||||
}
|
|
@ -7,6 +7,7 @@ Add styles or import other files. */
|
|||
@import "custom";
|
||||
|
||||
// Base styles
|
||||
@import "k8s_community";
|
||||
@import "k8s_nav";
|
||||
|
||||
//Media queries
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<main role="main" class="td-main" {{ if (or (ne .FirstSection "case-studies") (not .IsSection) ) }}data-pagefind-body{{ end }}>
|
||||
{{ 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 }}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
</a>
|
||||
{{ end -}}
|
||||
{{ block "deprecation_warning" . }}
|
||||
{{ partial "deprecation-warning.html" . }}
|
||||
{{ partial "version-banner.html" . }}
|
||||
{{ end }}
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<main role="main" class="col-xl-8" {{ if ne .Params.cid "docsHome" }}data-pagefind-body{{ end }}{{ if (and .IsPage .Params.description ) }} data-pagefind-meta="description:{{ .Params.description }}"{{ end }}>
|
||||
{{ 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" . }}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
{{ if (.Site.Param "deprecated") }}
|
||||
<section id="deprecation-warning">
|
||||
<div class="deprecation-warning {{ if $.IsHome }}home-pageinfo{{else}}pageinfo{{ end }}">
|
||||
<h3>
|
||||
{{ T "deprecation_title" }} {{ .Param "version" }}
|
||||
</h3>
|
||||
<p> Kubernetes {{ .Param "version" }} {{ T "deprecation_warning" }}
|
||||
<a href="{{ site.Params.currentUrl }}">{{ T "latest_version" }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
{{ else if and (eq .Section "blog") (not .Params.evergreen) .Date (.Date.Before (now.AddDate -1 0 0)) -}}
|
||||
<section id="deprecation-warning">
|
||||
<div class="deprecation-warning pageinfo outdated-blog">
|
||||
<p>{{ T "outdated_blog__message" }}</p>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
|
@ -0,0 +1,20 @@
|
|||
{{ $color := "primary" }}
|
||||
<!-- Check the variable that indicates whether this is an archived doc set.
|
||||
If yes, display a banner. -->
|
||||
{{ 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 }}
|
||||
<div class="pageinfo pageinfo-{{ $color }} k8s-deprecation-warning">
|
||||
{{ with $current_version }}
|
||||
<h3>
|
||||
{{ T "deprecation_title" }} {{ . | markdownify }}
|
||||
</h3>
|
||||
<p>Kubernetes {{ . | markdownify }} {{ T "deprecation_warning" }}
|
||||
<a href="{{ $latest_version | safeURL }}" target="_blank">{{ T "latest_version" }}</a></p>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ else if and (eq .Section "blog") (not .Params.evergreen) .Date (.Date.Before (now.AddDate -1 0 0)) -}}
|
||||
<div class="pageinfo pageinfo-{{ $color }}">
|
||||
<p>{{ T "outdated_blog__message" }}</p>
|
||||
</div>
|
||||
{{ end }}
|
Loading…
Reference in New Issue