Skip to content

Commit 4238897

Browse files
authored
Merge pull request #46684 from sftim/20240605_hbd_k8s
Congratulate Kubernetes on its 10th birthday
2 parents a02b447 + 13a96f0 commit 4238897

File tree

10 files changed

+832
-5
lines changed

10 files changed

+832
-5
lines changed

assets/images/k8s-10th-birthday.svg

Lines changed: 676 additions & 0 deletions
Loading

assets/scss/_base.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ section#cncf {
477477
}
478478

479479
// OCEAN NODES
480-
#oceanNodes {
480+
#oceanNodes, .td-home .k8s-overview {
481+
481482
padding-top: $ocean-nodes-padding-Y;
482483
padding-bottom: $ocean-nodes-padding-Y;
483484

assets/scss/_custom.scss

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,4 +1413,101 @@ div.alert > em.javascript-required {
14131413
cursor: pointer;
14141414
text-align: right;
14151415
padding: 0.2rem;
1416+
}
1417+
1418+
// Special style for Kubernetes' 10th birthday
1419+
section.k8s-birthday-override {
1420+
background: #dae9f9; // Kubernetes light blue
1421+
1422+
> .k8s-birthday-wrapper {
1423+
display: flex;
1424+
flex-direction: row;
1425+
justify-content: center;
1426+
align-items: center;
1427+
align-content: flex-end;
1428+
gap: 2rem;
1429+
1430+
img.birthday-banner {
1431+
max-height: 20rem;
1432+
max-width: 100vw;
1433+
margin-left: auto;
1434+
margin-right: auto;
1435+
aspect-ratio: 1;
1436+
flex-grow: 1;
1437+
}
1438+
p {
1439+
flex-grow: 4;
1440+
text-align: center;
1441+
color: $blue;
1442+
font-size: 2.5em;
1443+
padding-bottom: 2.5rem;
1444+
margin: 1em;
1445+
}
1446+
}
1447+
1448+
div.k8s-birthday-override.revert-to-previous {
1449+
form {
1450+
display: block;
1451+
max-width: clamp(20rem, 30%, 100vw);
1452+
margin-left: auto;
1453+
padding-bottom: 0.5rem;
1454+
}
1455+
text-align: right;
1456+
label {
1457+
color: $blue;
1458+
padding-left: 1.2em;
1459+
padding-right: 1.2em;
1460+
text-decoration: underline;
1461+
font-size: 1.5rem;
1462+
}
1463+
input {
1464+
accent-color: $blue;
1465+
border-color: $blue;
1466+
visibility: hidden;
1467+
}
1468+
}
1469+
1470+
div.k8s-birthday-override.revert-to-previous:has(input:not(:checked)) {
1471+
display: initial;
1472+
}
1473+
1474+
&:has(input:checked) {
1475+
display: none;
1476+
}
1477+
}
1478+
1479+
@media screen and (max-width: 900px) {
1480+
section.k8s-birthday-override > .k8s-birthday-wrapper {
1481+
flex-wrap: wrap;
1482+
}
1483+
}
1484+
1485+
@media screen and (max-width: 900px) {
1486+
section.k8s-birthday-override > .k8s-birthday-wrapper {
1487+
gap: 0.2rem;
1488+
align-content: center;
1489+
p {
1490+
font-size: initial;
1491+
min-width: 80vw;
1492+
}
1493+
img.birthday-banner {
1494+
min-height: initial;
1495+
}
1496+
label {
1497+
font-size: 1.2rem;
1498+
}
1499+
}
1500+
}
1501+
@media screen and (max-aspect-ratio: 9/15) {
1502+
gap: 0.4rem;
1503+
}
1504+
1505+
@media screen and (min-width: 1281px) {
1506+
img.birthday-banner {
1507+
min-height: clamp(480px, 25rem, 100vh);
1508+
}
1509+
}
1510+
section.k8s-birthday-override:has(div.k8s-birthday-override.revert-to-previous input:not(:checked)) + section {
1511+
display: none;
1512+
visibility: hidden;
14161513
}

assets/scss/_desktop.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $video-section-height: 550px;
2323
}
2424
}
2525

26-
#oceanNodes {
26+
#oceanNodes, .td-home .k8s-overview {
2727
.main-section {
2828
position: relative;
2929

assets/scss/_tablet.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ $feature-box-div-width: 45%;
6666
}
6767
}
6868

69-
#oceanNodes {
69+
#oceanNodes, .td-home .k8s-overview {
7070
h3 {
7171
text-align: left;
7272
margin-bottom: 18px;

content/en/_index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
{{< site-searchbar >}}
1010

11-
{{< blocks/section id="oceanNodes" >}}
12-
{{% blocks/feature image="flower" %}}
11+
<!-- automatically replaced if Kubernetes birthday feature active -->
12+
{{< blocks/section class="k8s-overview" >}}
13+
{{% blocks/feature image="flower" id="feature-primary" %}}
1314
[Kubernetes]({{< relref "/docs/concepts/overview/" >}}), also known as K8s, is an open source system for automating deployment, scaling, and management of containerized applications.
1415

1516
It groups containers that make up an application into logical units for easy management and discovery. Kubernetes builds upon [15 years of experience of running production workloads at Google](http://queue.acm.org/detail.cfm?id=2898444), combined with best-of-breed ideas and practices from the community.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Kubernetes' 10th birthday
3+
content_type: special
4+
5+
display_date_start: 2024-06-06
6+
display_date_end: 2024-06-15
7+
8+
# Only ever included, not rendered as a page in its own right
9+
_build:
10+
list: never
11+
render: false
12+
---
13+
Kubernetes 10 Years

data/i18n/en/en.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ other = "email address"
209209
[javascript_required]
210210
other = "JavaScript must be [enabled](https://www.enable-javascript.com/) to view this content"
211211

212+
[k8s_birthday_show_original_content]
213+
other = "Show original content…"
214+
212215
[katacoda_message]
213216
other = """<h4>Shutdown of interactive tutorials</h4>
214217
<p>The interactive tutorials on this website are being shut down. The Kubernetes
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{- $shouldShowBirthdayBanner := false -}}
2+
{{- $now := time.Now -}}
3+
{{- with site.GetPage "page" "community/special/kubernetes-10th-birthday" -}}
4+
{{- if and (lt ( (.Param "display_date_start") | time.AsTime ) $now ) (gt ( (.Param "display_date_end") | time.AsTime ) ( $now.AddDate 0 0 1 ) ) -}}
5+
{{- $shouldShowBirthdayBanner = true -}}
6+
{{- warnf "%s" "It's Kubernetes' birthday, fingers crossed this renders OK" -}}
7+
{{- with resources.Get "images/k8s-10th-birthday.svg" -}}
8+
{{- else -}}
9+
{{- errorf "%s" "Birthday banner image missing" -}}
10+
{{- end -}}
11+
{{ end }}
12+
{{- end -}}
13+
{{- if $shouldShowBirthdayBanner -}}
14+
<section id="{{ .id }}" class="k8s-birthday-override">
15+
<div class="k8s-birthday-wrapper">
16+
<p>{{ "2014-06-06" | time.AsTime | time.Format ":date_long" }}</p>
17+
{{- with site.GetPage "page" "community/special/kubernetes-10th-birthday" -}}
18+
<img src="{{ with resources.Get "images/k8s-10th-birthday.svg" }}{{ .RelPermalink }}{{ end }}" class="birthday-banner" title="{{ .Title | markdownify }}" alt="{{ .Content }}" ></img>
19+
{{- else -}}
20+
{{- errorf "%s" "10th Birthday content missing" -}}
21+
{{- end -}}
22+
<p>{{ printf "%s-06-06" ( time.Format "2006" $now ) | time.AsTime | time.Format ":date_long" }}</p>
23+
</div>
24+
<div class="k8s-birthday-override revert-to-previous">
25+
<form><label for="skip-birthday-details">{{ T "k8s_birthday_show_original_content" }}</label><input type=checkbox id="skip-birthday-details"></form>
26+
</div>
27+
</section>
28+
{{- end -}}
29+
<section id="{{ .id }}"{{ with .class }} class="{{ . }}"{{ end }}>
30+
{{ .inner }}
31+
</section>

layouts/shortcodes/blocks/section.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
{{- $style := .Get "style" -}}
33
{{- $id := .Get "id" | default (printf "section-%d" .Ordinal) -}}
44
{{- $bg := .Get "background-image" -}}
5+
{{/* special case Kubernetes overview */}}
6+
{{- if eq $class "k8s-overview" -}}
7+
{{- partial "kubernetes-overview.html" (dict "id" $id "class" $class "inner" $.Inner ) -}}
8+
{{- else -}}
59
{{- if $bg -}}
610
{{ template "shortcodes-blocks_getimage" (dict "name" $bg "ctx" . "target" "bg") }}
711
{{- end -}}
812
{{- $image := $.Scratch.Get "bg" -}}
913
<section id="{{ $id }}"{{ with $class }} class="{{ . }}"{{ end }} style="{{ with $image }}background-image: url({{ .Permalink }}); {{ end }}{{ with $style }}{{ . | safeCSS }}{{ end }}">
1014
{{ $.Inner }}
1115
</section>
16+
{{- end -}}

0 commit comments

Comments
 (0)