Skip to content

Commit d432d05

Browse files
authored
Merge branch 'main' into main-uk-wip
2 parents aeb637a + bea77e0 commit d432d05

File tree

251 files changed

+7468
-1276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+7468
-1276
lines changed

OWNERS_ALIASES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ aliases:
127127
- inductor
128128
- nasa9084
129129
- Okabe-Junya
130+
- t-inu
130131
sig-docs-ja-reviews: # PR reviews for Japanese content
131132
- atoato88
132133
- b1gb4by

assets/js/custom-search.js

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
document.querySelector('html').classList.add('search');
2+
3+
document.addEventListener('DOMContentLoaded', function() {
4+
let searchTerm = new URLSearchParams(window.location.search).get('q');
5+
let fetchingElem = document.getElementById('bing-results-container');
6+
7+
if (!searchTerm) {
8+
if (fetchingElem) fetchingElem.style.display = 'none';
9+
}
10+
});
11+
12+
window.renderGoogleSearchResults = () => {
13+
const cx = '013288817511911618469:elfqqbqldzg';
14+
const gcse = document.createElement('script');
15+
gcse.type = 'text/javascript';
16+
gcse.async = true;
17+
gcse.src = (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cse.google.com/cse.js?cx=' + cx;
18+
const s = document.getElementsByTagName('script')[0];
19+
s.parentNode.insertBefore(gcse, s);
20+
}
21+
22+
window.renderPageFindSearchResults = () => {
23+
let urlParams = new URLSearchParams(window.location.search);
24+
let searchTerm = urlParams.get("q") || "";
25+
let sidebarSearch = document.querySelector('#search-results-search');
26+
if (sidebarSearch) {
27+
sidebarSearch.remove();
28+
}
29+
document.getElementById('search').style.display = 'block';
30+
let pagefind = new PagefindUI({ element: "#search", showImages: false });
31+
if (searchTerm) {
32+
pagefind.triggerSearch(searchTerm);
33+
}
34+
35+
document.querySelector("#search input").addEventListener("input", function() {
36+
const inputValue = this.value;
37+
const queryStringVar = "q";
38+
updateQueryString(queryStringVar, inputValue);
39+
});
40+
}
41+
42+
function updateQueryString(key, value) {
43+
const baseUrl = window.location.href.split("?")[0];
44+
const queryString = window.location.search.slice(1);
45+
const urlParams = new URLSearchParams(queryString);
46+
47+
if (urlParams.has(key)) {
48+
urlParams.set(key, value);
49+
} else {
50+
urlParams.append(key, value);
51+
}
52+
53+
const newUrl = baseUrl + "?" + urlParams.toString();
54+
// Update the browser history (optional)
55+
history.replaceState(null, '', newUrl);
56+
}
57+
58+
// China Verification.
59+
const path = "path=/;";
60+
let d = new Date()
61+
d.setTime(d.getTime() + (7 * 24 * 60 * 60 * 1000))
62+
let expires = "expires=" + d.toUTCString()
63+
64+
function getCookie(name) {
65+
const value = "; " + document.cookie;
66+
const parts = value.split("; " + name + "=");
67+
if (parts.length === 2) return parts.pop().split(";").shift();
68+
else return "";
69+
}
70+
71+
async function checkBlockedSite(url) {
72+
const controller = new AbortController();
73+
const timeout = setTimeout(() => {
74+
controller.abort();
75+
}, 5000); // Timeout set to 5000ms (5 seconds)
76+
77+
try {
78+
const response = await fetch(url, { method: 'HEAD', mode: 'no-cors', signal: controller.signal });
79+
// If we reach this point, the site is accessible (since mode: 'no-cors' doesn't allow us to check response.ok)
80+
clearTimeout(timeout);
81+
return false;
82+
} catch (error) {
83+
// If an error occurs, it's likely the site is blocked
84+
return true;
85+
}
86+
}
87+
88+
async function loadSearch() {
89+
if (getCookie("can_google") === "") {
90+
const isGoogleBlocked = await checkBlockedSite("https://www.google.com/favicon.ico");
91+
if ( isGoogleBlocked ) {
92+
// Google is blocked.
93+
document.cookie = "can_google=false;" + path + expires
94+
window.renderPageFindSearchResults()
95+
} else {
96+
// Google is not blocked.
97+
document.cookie = "can_google=true;" + path + expires
98+
window.renderGoogleSearchResults()
99+
}
100+
} else if (getCookie("can_google") === "false") {
101+
window.renderPageFindSearchResults()
102+
} else {
103+
window.renderGoogleSearchResults()
104+
}
105+
}
106+
107+
(function ($) {
108+
"use strict";
109+
110+
const Search = {
111+
init: function () {
112+
$(document).ready(function () {
113+
// Fill the search input form with the current search keywords
114+
const searchKeywords = new URLSearchParams(location.search).get('q');
115+
if (searchKeywords !== null && searchKeywords !== '') {
116+
const searchInput = document.querySelector('.td-search-input');
117+
searchInput.focus();
118+
searchInput.value = searchKeywords;
119+
}
120+
121+
// Set a keydown event
122+
$(document).on("keypress", ".td-search-input", function (e) {
123+
if (e.keyCode !== 13) {
124+
return;
125+
}
126+
127+
const query = $(this).val();
128+
document.location = $(this).data('search-page') + "?q=" + query;
129+
130+
return false;
131+
});
132+
});
133+
},
134+
};
135+
136+
Search.init();
137+
})(jQuery);
138+
139+
window.onload = loadSearch;

assets/js/search.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

assets/scss/_base.scss

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -462,16 +462,6 @@ $video-section-height: 200px;
462462
}
463463
}
464464

465-
// Add logo to CNCF section
466-
section#cncf {
467-
padding-top: 60px;
468-
padding-bottom: 140px;
469-
background-image: url(/images/cncf-color.svg);
470-
background-position: center 100px;
471-
background-repeat: no-repeat;
472-
background-size: 300px;
473-
}
474-
475465
// OCEAN NODES
476466
#oceanNodes, .td-home .k8s-overview {
477467

assets/scss/_custom.scss

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,32 @@ input[type="search"]{
340340
}
341341

342342

343+
.cncf-logo-details {
344+
display: flex;
345+
flex-direction: column;
346+
padding: 30px;
347+
align-items: center;
348+
349+
p {
350+
text-align: center;
351+
font-size: 1.2rem;
352+
}
353+
354+
a {
355+
color: inherit;
356+
background: transparent;
357+
text-decoration: underline; // exception from usual convention
358+
}
359+
360+
picture {
361+
display: block;
362+
> * {
363+
min-height: 4em;
364+
width: calc(clamp(20em,18em + 20mm,100vw));
365+
}
366+
}
367+
}
368+
343369
/* FOOTER */
344370
footer {
345371
background-color: #202020;
@@ -469,6 +495,91 @@ footer {
469495
}
470496
}
471497

498+
// Home page dark-mode
499+
@media (prefers-color-scheme: dark) {
500+
body.cid-home {
501+
main {
502+
background-color: $dark-bg-color-2;
503+
color:$dark-text-color-1;
504+
505+
section:not(#video):not(#cncf) {
506+
background-color: $dark-bg-color-1;
507+
color:$dark-text-color-1;
508+
}
509+
510+
section#video #desktopShowVideoButton {
511+
background-color: $dark-bg-color-1;
512+
}
513+
514+
section#video #desktopShowVideoButton {
515+
color: $white;
516+
background-color: $primary;
517+
518+
&:hover {
519+
color: $primary;
520+
background-color: $white;
521+
}
522+
523+
&::before {
524+
border-color: transparent transparent transparent $white;
525+
}
526+
527+
&:hover::before {
528+
border-color: transparent transparent transparent $primary;
529+
}
530+
}
531+
532+
section#video #desktopKCButton:hover {
533+
background-color: $dark-bg-color-1;
534+
}
535+
536+
section#cncf {
537+
background-color: $dark-bg-color-2;
538+
}
539+
540+
section.features-container .k8s-features-heading {
541+
color: $white;
542+
background-color: $dark-bg-color-1;
543+
}
544+
545+
section.features-container > div > .feature-box {
546+
background-color: $dark-bg-color-2;
547+
color:$dark-text-color-1;
548+
549+
h3 a, h4 a, h5 a {
550+
color: $white;
551+
background: transparent;
552+
}
553+
554+
h3 a:hover, h4 a:hover, h5 a:hover {
555+
text-decoration: underline;
556+
}
557+
}
558+
559+
.search-bar {
560+
background-color: #d3d3d3;
561+
color: #ffffff;
562+
> * {
563+
color: #ffffff;
564+
}
565+
}
566+
567+
input.search-input, input.email {
568+
background-color: #D3D3D3 !important;
569+
color: #000 !important;
570+
}
571+
572+
input.search-input::placeholder, input.email::placeholder{
573+
color: #000;
574+
}
575+
576+
#mc_embed_signup_scroll input.email {
577+
color: #ffffff !important;
578+
background-color: #a9a9a9 !important;
579+
}
580+
}
581+
}
582+
}
472583

473584
/* COMMUNITY */
474585

assets/scss/_documentation.scss

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,6 @@ div.feature-state-notice {
163163
background-color: rgba(255, 255, 255, 0.25);
164164
}
165165

166-
/* Sidebar menu */
167-
#td-sidebar-menu {
168-
#m-docs span, small {
169-
visibility: hidden;
170-
}
171-
#m-docs small {
172-
visibility: collapse; // if supported
173-
}
174-
}
175-
176166
/* Styles for CVE table */
177167
table tr.cve-status-open, table tr.cve-status-unknown {
178168
> td.cve-item-summary {

assets/scss/_variables_project.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ $tooltip-font-size: 1rem;
2727
$tooltip-padding: 5px 8px;
2828
$tooltip-border-radius: 6px;
2929
$tooltip-font-weight: 400;
30+
31+
// light / dark mode support
32+
$dark-bg-color-1: #303030;
33+
$dark-bg-color-2: #4f4f4f;
34+
$dark-text-color-1: #ffffff;
35+
$dark-text-color-2: #3371e3;

content/en/_index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
priority: 1.0
77
---
88

9-
{{< site-searchbar >}}
10-
119
{{< blocks/section class="k8s-overview" >}}
1210
{{% blocks/feature image="flower" id="feature-primary" %}}
1311
[Kubernetes]({{< relref "/docs/concepts/overview/" >}}), also known as K8s, is an open source system for automating deployment, scaling, and management of containerized applications.

0 commit comments

Comments
 (0)