Revise the Kubernetes website to use Docsy (#20874)

* Add Docsy, required packages and config

* Apply Docsy integration work to k8s website

This encompasses significant changes to the style system, layout files,
as well as changes to some of the static assets. To examine this work
and the iterations that were performed, the original repository can be
found at https://github.com/gearbox-built/kubernetes-hugo.git

* Address issues found in review

The styling and positioning of the header, footer, some shortcodes and
main container elements are improved. A new partial is added for
favicons. The sidebars, as well as inner table of contents, have been
altered for better positioning and rendering of content. Localization
has also been addressed.

* Enable announcements

The recent Black Lives Matter announcement surfaced issues which have
been addressed.
This commit is contained in:
Aidan Ranney
2020-06-15 12:09:57 -07:00
committed by GitHub
parent 49ac273969
commit 0625ced466
72 changed files with 4174 additions and 992 deletions
+13
View File
@@ -0,0 +1,13 @@
<div class="td-page-blog-meta ml-2 pb-1 pt-2 mb-4">
{{ with site.Home.OutputFormats.Get "rss" -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}" title="{{ site.Title }}">
<a class="widget-link" href="{{ .Permalink | safeURL }}"><div> <i class="fas fa-rss fab-icon"> </i> <span class="widget-link-text">RSS Feed</span></div> </a>
{{ end -}}
<a class="widget-link" href="https://kubernetes.io/docs/contribute/start/#write-a-blog-post"><div> <i class="fa fa-edit fab-icon"></i> <span class="widget-link-text">Submit a Post</span></div></a>
<a class="widget-link" href="https://twitter.com/kubernetesio"><div> <i class="fab fa-twitter-square fab-icon"> </i> <span class="widget-link-text"> @Kubernetesio</span></div></a>
<a class="widget-link" href="https://github.com/kubernetes/kubernetes"><div> <i class="fab fa-github-square fab-icon"></i> <span class="widget-link-text"> on GitHub </span></div></a>
<a class="widget-link" href="http://slack.k8s.io"><div><i class="fab fa-slack fab-icon"> </i> <span class="widget-link-text">#kubernetes-users </span></div></a>
<a class="widget-link" href="https://stackoverflow.com/questions/tagged/kubernetes"><div><i class="fab fa-stack-overflow fab-icon"></i> <span class="widget-link-text"> Overflow</span></div></a>
<a class="widget-link" href="https://discuss.kubernetes.io"><div> <i class="fab fa-discourse fab-icon"></i><span class="widget-link-text"> Forum </span></div></a>
<a class="widget-link" href="https://kubernetes.io/docs/setup"><div><i class="fa fa-download fab-icon"></i> <span class="widget-link-text"> Kubernetes</span></div></a>
</div>
+92
View File
@@ -0,0 +1,92 @@
{{/* The blog nav organizes posts grouped by year, which represents a customized version of the
sidebar-tree in use elsewhere on the site. */}}
{{/* We cache this partial for bigger sites and set the active class client side. */}}
{{ $shouldDelayActive := ge (len .Site.Pages) 2000 }}
<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}">
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
<!-- {{ if (gt (len .Site.Home.Translations) 0) }}
<div class="nav-item dropdown d-block d-lg-none">
{{ partial "navbar-lang-selector.html" . }}
</div>
{{ end }} -->
{{ template "blog-nav-section" (dict "page" . "section" .FirstSection "delayActive" $shouldDelayActive) }}
</nav>
</div>
{{ define "blog-nav-section" }}
{{ $shouldDelayActive := .delayActive }}
{{ $sid := .section.RelPermalink | anchorize }}
{{ $postsByYear := .section.Pages.GroupByDate "2006" }}
{{ range $postsByYear }}
{{ $year := .Key }}
{{ $p := $.page }}
{{ $active := eq ($p.Date.Format "2006") $year }}
{{ $firstPost := .Pages | first 1 }}
<ul class="td-sidebar-nav__section pr-md-3">
<li class="td-sidebar-nav__section-title">
<a href="{{range $firstPost}}{{ .RelPermalink }}{{end}}" class="align-left pl-0 pr-2{{ if not $active }} collapsed{{ end }}{{ if $active}} active{{ end }} td-sidebar-link td-sidebar-link__section">
{{ $year }}
</a>
</li>
{{ $firstPages := .Pages | first 10 }}
{{ $remainingPages := .Pages | after 10 }}
{{ $displayRemainingPages := false }}
<ul>
{{ range $firstPages }}
{{ if .IsPage }}
<li class="blog-post collapse {{ if $active }}show{{ end }}" data-year={{$year}}>
{{ $mid := printf "m-%s" (.RelPermalink | anchorize) }}
{{ $active := eq . $p }}
<a class="td-sidebar-link td-sidebar-link__page {{ if and (not $shouldDelayActive) $active }} active{{ end }}" id="{{ $mid }}" href="{{ .RelPermalink }}">
{{ .LinkTitle }}
</a>
</li>
{{ end }}
{{ end }}
<li class="more-posts collapse {{ if $active }}show{{ end }}" data-year="{{$year}}">
<a class="td-sidebar-link" id="more-posts" href="">Show More Posts...</a>
</li>
{{ range $remainingPages }}
{{ if .IsPage }}
<li class="blog-post hidden collapse" data-year={{$year}}>
{{ $mid := printf "m-%s" (.RelPermalink | anchorize) }}
{{ $active := eq . $p }}
<a class="td-sidebar-link td-sidebar-link__page {{ if and (not $shouldDelayActive) $active }} active{{ end }}" id="{{ $mid }}" href="{{ .RelPermalink }}">
{{ .LinkTitle }}
</a>
</li>
{{ end }}
{{ end }}
</ul>
</ul>
{{ end }}
{{ end }}
{{/* Reveal the remaining blog posts and hide the clicked link */}}
<script>
let morePosts = document.querySelectorAll(".more-posts");
let year = "";
morePosts.forEach(link => {
link.onclick = (e) => {
e.preventDefault();
year = link.dataset.year;
console.log(year);
let hiddenPosts = document.querySelectorAll(`.blog-post.hidden[data-year="${year}"]`);
console.log(hiddenPosts);
hiddenPosts.forEach(post => {
post.classList.add('show');
post.classList.remove("hidden");
});
link.style.display = "none";
}
});
</script>
+22 -20
View File
@@ -1,21 +1,20 @@
<!-- All former base stylesheet links commented out as we are using Docsy for styles. -->
{{ $inServerMode := site.IsServer }}
{{ $sass := "sass/style.sass" }}
{{ $cssOutput := "css/style.css" }}
{{ $devOpts := (dict "targetPath" $cssOutput "enableSourceMap" true) }}
{{ $prodOpts := (dict "targetPath" $cssOutput "outputStyle" "compressed") }}
{{ $cssOpts := cond $inServerMode $devOpts $prodOpts }}
{{ $css := resources.Get $sass | resources.ExecuteAsTemplate $sass . | toCSS $cssOpts }}
{{ if $inServerMode }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{ else }}
{{ $prodCss := $css | fingerprint }}
<link rel="stylesheet" href="{{ $prodCss.RelPermalink }}" integrity="{{ $prodCss.Data.Integrity }}">
{{ end }}
<link rel="stylesheet" href="/css/base_fonts.css">
{{- if .Params.case_study_styles }}
<link rel="stylesheet" href="/css/case-study-styles.css">
{{ $cssOutput := "css/case-studies.css" }}
{{ $caseStudiesCSS := resources.Get "scss/_case-studies.scss" | resources.ToCSS }}
{{ if $inServerMode }}
<link rel="stylesheet" href="{{ $caseStudiesCSS.RelPermalink }}">
{{ else }}
{{ $prodCaseStudiesCSS := $caseStudiesCSS | fingerprint }}
<link rel="stylesheet" href="{{ $prodCaseStudiesCSS.RelPermalink }}" integrity="{{ $prodCaseStudiesCSS.Data.Integrity }}">
{{ end }}
{{- end }}
<link rel="stylesheet" href="{{ "css/jquery-ui.min.css" | relURL }}">
<link rel="stylesheet" href="{{ "css/callouts.css" | relURL }}">
<link rel="stylesheet" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
@@ -25,16 +24,19 @@
{{- if .Site.Params.deprecated }}
<link rel="stylesheet" href="{{ "css/deprecation-warning.css" | relURL }}">
{{- end }}
{{- if or (eq .Params.class "gridPage") (eq .Params.class "gridPage gridPageHome") }}
<link rel="stylesheet" href="{{ "css/gridpage.css" | relURL }}">
<link rel="stylesheet" href="{{ "css/gridpage.css" | relURL }}">
{{- end }}
{{- if eq .Params.class "training" }}
<link rel="stylesheet" href="{{ "css/training.css" | relURL }}">
<link rel="stylesheet" href="{{ "css/training.css" | relURL }}">
{{- end }}
{{- with .Params.css }}
{{- $extraCss := split . "," }}
{{- range $extraCss }}
{{- $url := trim . " " | relURL }}
<link rel="stylesheet" href="{{ $url }}"><!-- custom css added -->
{{- $extraCss := split . "," }}
{{- range $extraCss }}
{{- $url := trim . " " | relURL }}
<link rel="stylesheet" href="{{ $url }}"><!-- custom css added -->
{{- end }}
{{- end }}
{{- end }}
+2 -4
View File
@@ -6,9 +6,7 @@
</a>
</p>
{{ if not .page.Params.notitle }}
<h1>{{ .page.Title }}</h1>
{{ end }}
{{ if and (not .page.Params.toc_hide) (not (.page.HasShortcode "toc")) }}
{{ .page.TableOfContents }}
<h1>{{ .page.Title }}</h1>
{{ end }}
{{ .page.Content }}
@@ -0,0 +1,27 @@
{{ range .Params.cards }}
<div class="launch-card">
<h2 id="{{ replace .title " " "-" | lower }}">{{ .title }}</h2>
<p>{{ .description }}</p>
<ul>
{{ $name := .name }}
{{ range where ($.Site.Pages.ByParam "card.weight") ".Params.card" "!=" nil }}
{{ if eq .Params.card.name $name }}
{{ $p := . }}
{{ if (isset .Params.card "anchors") }}
{{ range .Params.card.anchors }}
<li><a href="{{ $p.Permalink }}{{ .anchor }}">{{ .title }}</a></li>
{{ end }}
{{ else }}
<li><a href={{ .Permalink }}>
{{ if (isset .Params.card "title") }}{{ .Params.card.title }}{{ else }}{{ .LinkTitle }}{{ end }}
</a></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
<br>
<button id="btn-concepts" class="button" onClick="location.href='{{ .button_path | relLangURL }}';" aria-label="{{ .title }}">{{ .button }}</button>
<br>
<br>
</div>
{{ end }}
+4
View File
@@ -0,0 +1,4 @@
<link rel="shortcut icon" type="image/png" href="{{ "images/favicon.png" | relURL }}">
<link rel="apple-touch-icon" href="{{ "favicons/apple-touch-icon-180x180.png" | relURL }}" sizes="180x180">
<link rel="manifest" href="/manifest.webmanifest">
<link rel="apple-touch-icon" href="/images/kubernetes-192x192.png">
+19 -17
View File
@@ -1,22 +1,24 @@
{{ if not .Params.hide_feedback }}
<div id="pre-footer">
<h2>{{ T "feedback_heading" }}</h2>
<p class="feedback--prompt">{{ T "feedback_question" }} </p>
<button class="button feedback--yes">{{ T "feedback_yes" }}</button>
<button class="button feedback--no">{{ T "feedback_no" }}</button>
<p class="feedback--response feedback--response__hidden">
{{ T "layouts_docs_partials_feedback_thanks" }}
<a target="_blank" rel="noopener"
href="https://stackoverflow.com/questions/tagged/kubernetes">
Stack Overflow</a>.
{{ T "layouts_docs_partials_feedback_issue" }}
<a class="feedback--link" target="_blank" rel="noopener"
href="https://github.com/kubernetes/website/issues/new?title=Issue%20with%20k8s.io">
{{ T "layouts_docs_partials_feedback_problem" }}</a>
{{ T "layouts_docs_partials_feedback_or" }}
<a class="feedback--link" target="_blank" rel="noopener"
href="https://github.com/kubernetes/website/issues/new?title=Improvement%20for%20k8s.io">
{{ T "layouts_docs_partials_feedback_improvement" }}</a>.
</p>
<p class="feedback--prompt">{{ T "feedback_question" }} </p>
<button class="btn btn-primary mb-4 feedback--yes">{{ T "feedback_yes" }}</button>
<button class="btn btn-primary mb-4 feedback--no">{{ T "feedback_no" }}</button>
<p class="feedback--response feedback--response__hidden">
{{ T "layouts_docs_partials_feedback_thanks" }}
<a target="_blank" rel="noopener"
href="https://stackoverflow.com/questions/tagged/kubernetes">
Stack Overflow</a>.
{{ T "layouts_docs_partials_feedback_issue" }}
<a class="feedback--link" target="_blank" rel="noopener"
href="https://github.com/kubernetes/website/issues/new?title=Issue%20with%20k8s.io">
{{ T "layouts_docs_partials_feedback_problem" }}</a>
{{ T "layouts_docs_partials_feedback_or" }}
<a class="feedback--link" target="_blank" rel="noopener"
href="https://github.com/kubernetes/website/issues/new?title=Improvement%20for%20k8s.io">
{{ T "layouts_docs_partials_feedback_improvement" }}</a>.
</p>
</div>
<script>
const yes = document.querySelector('.feedback--yes');
const no = document.querySelector('.feedback--no');
+51 -36
View File
@@ -1,37 +1,52 @@
<footer>
<div class="light-text main-section">
<nav>
{{ with site.GetPage "page" "docs/tutorials/stateless-application/hello-minikube" }}<a href="{{ .RelPermalink }}" data-proofer-ignore>{{ .LinkTitle }}</a>{{ end }}
{{ $sections := slice "docs/home" "blog" "training" "partners" "community" "case-studies" }}
{{ range $sections }}
{{ with site.GetPage "section" . }}<a href="{{ .RelPermalink }}" data-proofer-ignore>{{ .LinkTitle }}</a>{{ end }}
{{ end }}
</nav>
<div class="social" role="region" aria-label="Social hyperlinks">
<div>
<a href="https://twitter.com/kubernetesio" class="twitter"><span>{{ T "community_twitter_name" }}</span></a>
<a href="https://github.com/kubernetes/kubernetes" class="github"><span>{{ T "community_github_name" }}</span></a>
<a href="https://slack.k8s.io/" class="slack"><span>Slack</span></a>
</div>
<div>
<a href="https://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>{{ T "community_stack_overflow_name" }}</span></a>
<a href="https://www.youtube.com/kubernetescommunity" class="youtube"><span>{{ T "community_youtube_name" }}</span></a>
<a href="https://discuss.kubernetes.io" class="mailing-list"><span>{{ T "community_forum_name" }}</span></a>
<a href="https://calendar.google.com/calendar/embed?src=cgnt364vd8s86hr2phapfjc6uk%40group.calendar.google.com" class="calendar"><span>{{ T "community_events_calendar" }}</span></a>
</div>
<div>
{{ with site.GetPage "page" "/docs/setup/pick-right-solution/" }}<a href="{{ .RelPermalink }}" class="button">{{ .LinkTitle }}</a>{{ end }}
<a href="https://git.k8s.io/community/contributors/guide" class="button">{{ T "main_contribute" }}</a>
</div>
</div>
<div class="miceType center">
&copy; {{ now.Year }} {{ T "main_documentation_license" | safeHTML }}</a>
</div>
<div class="miceType center">
Copyright &copy; {{ now.Year }} {{ T "main_copyright_notice" | safeHTML }}
</div>
<div class="miceType center">
ICP license: 京ICP备17074266号-3
</div>
{{ $links := .Site.Params.links }}
<footer class="d-print-none">
<div class="footer__links">
<nav>
{{ with site.GetPage "page" "docs/tutorials/stateless-application/hello-minikube" }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
{{ $sections := slice "docs/home" "blog" "training" "partners" "community" "case-studies" }}
{{ range $sections }}
{{ with site.GetPage "section" . }}<a class="text-white" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
{{ end }}
</nav>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-6 col-sm-2 text-xs-center order-sm-2">
{{ with $links }}
{{ with index . "user"}}
{{ template "footer-links-block" . }}
{{ end }}
{{ end }}
</div>
<div class="col-6 col-sm-2 text-right text-xs-center order-sm-3">
{{ with $links }}
{{ with index . "developer"}}
{{ template "footer-links-block" . }}
{{ end }}
{{ end }}
</div>
<div class="col-12 col-sm-8 text-center order-sm-2">
{{ with .Site.Params.copyright_k8s }}<small class="text-white">&copy; {{ now.Year}} {{ T "main_documentation_license" | safeHTML }}</small>{{ end }}
<br/>
{{ with .Site.Params.copyright_linux }}<small class="text-white">Copyright &copy; {{ now.Year }} {{ T "main_copyright_notice" | safeHTML }}</small>{{ end }}
<br/>
<small class="text-white">ICP license: 京ICP备17074266号-3</small>
{{ with .Site.Params.privacy_policy }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_privacy_policy" }}</a></small>{{ end }}
{{ if not .Site.Params.ui.footer_about_disable }}
{{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }}
{{ end }}
</div>
</div>
</footer>
</div>
</footer>
{{ define "footer-links-block" }}
<ul class="list-inline mb-0">
{{ range . }}
<li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="{{ .name }}" aria-label="{{ .name }}">
<a class="text-white" target="_blank" href="{{ .url }}">
<i class="{{ .icon }}"></i>
</a>
</li>
{{ end }}
</ul>
{{ end }}
+40 -21
View File
@@ -1,32 +1,51 @@
<div id="pre-footer"> <!-- This is at the bottom of every topic underneath the TOC and content -->
<hr />
<div id="pre-footer">
<!-- This is at the bottom of every topic underneath the TOC and content -->
<hr/>
<div class="issue-button-container">
<p><a href=""><img src="https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/{{ .Path }}?pixel" alt="Analytics" /></a></p>
<p>
<a href=""><img alt="Analytics" src="https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/{{ .Path }}?pixel"/></a>
</p>
{{ if and (ne .Kind "404") (not (strings.Contains .Path "search")) }}
{{ if not .Params.no_issue }}
<script type="text/javascript">
PDRTJS_settings_8345992 = {
"id" : "8345992",
"unique_id" : "{{ .RelPermalink }}",
"title" : "{{ .Title }}",
"permalink" : "{{ .Permalink }}"
};
(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/js/rating/rating.js':'http://i0.poll.fm/js/rating/rating.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-rating-js'));
</script>
<a href="" onclick="window.open('https://github.com/kubernetes/website/issues/new?template=bug-report.md&title=Issue%20with%20' +
'k8s.io'+window.location.pathname)" class="button issue">{{ T "main_github_create_an_issue" }}</a>
{{ end }}
{{ if not .Params.no_issue }}
<script type="text/javascript">
PDRTJS_settings_8345992 = {
"id": "8345992",
"unique_id": "{{ .RelPermalink }}",
"title": "{{ .Title }}",
"permalink": "{{ .Permalink }}"
};
(function (d, c, j) {
if (!document.getElementById(j)) {
var pd = d.createElement(c),
s;
pd.id = j;
pd.src = ("https:" == document.location.protocol)
? "https://polldaddy.com/js/rating/rating.js"
: "http://i0.poll.fm/js/rating/rating.js";
s = document.getElementsByTagName(c)[0];
s.parentNode.insertBefore(pd, s);
}
}(document, "script", "pd-rating-js"));
</script>
<a class="btn btn-primary mb-4 issue" href="" onclick="window.open('https://github.com/kubernetes/website/issues/new?template=bug-report.md&title=Issue%20with%20' +
'k8s.io'+window.location.pathname)">{{ T "main_github_create_an_issue" }}</a>
{{ end }}
{{ end }}
{{ if not .Params.noedit }}
{{ if .File }}<a href="https://github.com/kubernetes/website/edit/master/content/{{ site.Language.Lang }}/{{ .File.Path }}" class="button issue">{{ T "main_edit_this_page" }}</a>{{ end }}
{{ if .File }}
<a class="btn btn-primary mb-4 issue" href="https://github.com/kubernetes/website/edit/master/content/{{ site.Language.Lang }}/{{ .File.Path }}">{{ T "main_edit_this_page" }}</a>
{{ end }}
{{ end }}
</div>
{{ if and (not .Params.showcommit) $.GitInfo }}
<div id="lastedit" class="lastedit issue-button-container">
{{ T "main_page_last_modified_on" }} {{ .GitInfo.AuthorDate.Format "January 02, 2006 at 3:04 PM PST" }} {{ T "main_by" }}
<a href="https://github.com/kubernetes/website/commit/{{ .GitInfo.Hash }}/">{{ .GitInfo.Subject }}</a> (<a href="https://github.com/kubernetes/website/commits/master/content/{{ site.Language.Lang }}/{{ .File.Path }}">{{ T "main_page_history" }}</a>)
</div>
<div class="lastedit issue-button-container" id="lastedit">
{{ T "main_page_last_modified_on" }}
{{ .GitInfo.AuthorDate.Format "January 02, 2006 at 3:04 PM PST" }}
{{ T "main_by" }}
<a href="https://github.com/kubernetes/website/commit/{{ .GitInfo.Hash }}/">{{ .GitInfo.Subject }}</a>
(<a href="https://github.com/kubernetes/website/commits/master/content/en/{{ .File.Path }}">{{ T "main_page_history" }}</a>)
</div>
{{ end }}
</div>
+36 -8
View File
@@ -9,8 +9,42 @@
gtag('config', 'UA-36037335-10');
</script>
<!-- Docsy head.html begins here -->
<meta charset="utf-8">
<title>{{ if .Title }}{{ .Title }} - {{ end }}{{ site.Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{ hugo.Generator }}
{{ if eq (getenv "HUGO_ENV") "production" }}
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
{{ else }}
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
{{ end }}
{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end -}}
{{ partialCached "favicons.html" . }}
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/google_news.html" . -}}
{{- template "_internal/schema.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
{{ if eq (getenv "HUGO_ENV") "production" }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{ partialCached "head-css.html" . "asdf" }}
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
{{ if and (.Site.Params.offlineSearch) (not .Site.Params.gcs_engine_id) }}
<script src="https://unpkg.com/lunr@2.1.6/lunr.js"></script>
<script src="/js/offline-search.js"></script>
{{end}}
{{ partial "hooks/head-end.html" . }}
<!-- Docsy head.html ends here -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
@@ -19,9 +53,7 @@
"logo": "https://kubernetes.io/images/favicon.png"
}
</script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#326ce5">
<link rel="shortcut icon" type="image/png" href="{{ "images/favicon.png" | relURL }}">
{{ partial "css.html" . }}
<!-- Content for social media sharing previews -->
<!-- Facebook uses the og: stuff, while Twitter and others use twitter: -->
@@ -43,9 +75,7 @@
{{ end }}
<meta property="og:type" content="{{ $ogType }}">
<script src="{{ "js/anchor-4.1.1.min.js" | relURL }}"></script>
<script src="{{ "js/jquery-3.2.1.min.js" | relURL }}"></script>
<script src="{{ "js/jquery-ui-1.12.1.min.js" | relURL }}"></script>
<script src="{{ "js/bootstrap-4.3.1.min.js" | relURL }}"></script>
<script src="{{ "js/sweetalert-2.1.2.min.js" | relURL }}"></script>
{{ if eq .Params.mermaid true }}
@@ -56,6 +86,4 @@
<script src="{{ "js/script.js" | relURL }}"></script>
<script src="{{ "js/custom-jekyll/tags.js" | relURL }}"></script>
{{ with .Params.js }}{{ range (split . ",") }}<script src="{{ (trim . " ") | relURL }}"></script><!-- custom js added -->
{{ end }}{{ else }}<!-- no custom js detected -->{{ end }}
<link rel="manifest" href="/manifest.webmanifest">
<link rel="apple-touch-icon" href="/images/kubernetes-192x192.png">
{{ end }}{{ else }}<!-- no custom js detected -->{{ end }}
+30
View File
@@ -0,0 +1,30 @@
{{ $cover := .HasShortcode "blocks/cover" }}
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }} flex-row td-navbar" data-auto-burger="primary">
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}"></a>
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
<ul class="navbar-nav mt-2 mt-lg-0">
{{ $p := . }}
{{ $sections := slice "docs" "blog" "training" "partners" "community" "case-studies" }}
{{ range $sections }}
{{ with site.GetPage "section" . }}
<li class="nav-item mr-2 mb-lg-0">
{{ $active := eq .Section $.Section }}
<a class="nav-link{{if $active }} active{{end}}" href="{{ .RelPermalink }}" >{{ .LinkTitle }}</span></a>
</li>
{{ end }}
{{ end }}
{{ if .Site.Params.versions }}
<li class="nav-item dropdown">
{{ partial "navbar-version-selector.html" . }}
</li>
{{ end }}
{{ if (gt (len .Site.Home.Translations) 0) }}
<li class="nav-item dropdown">
{{ partial "navbar-lang-selector.html" . }}
</li>
{{ end }}
</ul>
</div>
<button id="hamburger" onclick="kub.toggleMenu()" data-auto-burger-exclude><div></div></button>
</nav>
+10
View File
@@ -0,0 +1,10 @@
{{ if or .Site.Params.gcs_engine_id .Site.Params.algolia_docsearch }}
<input type="search" class="form-control td-search-input" placeholder="&#xf002 {{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off">
{{ else if .Site.Params.offlineSearch }}
<div id="search-nav-container">
<input type="search" id="search-input" autocomplete="off" class="form-control td-search-input" placeholder="&#xf002 {{ T "ui_search" }}" autocomplete="on">
<div id="search-results" class="container"></div>
</div>
{{ else if .Site.Params.k8s_search }}
<input type="search" class="form-control td-search-input" name="q" placeholder="&#xf002 {{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off">
{{ end }}
+63
View File
@@ -0,0 +1,63 @@
{{/* We cache this partial for bigger sites and set the active class client side. */}}
{{ $shouldDelayActive := ge (len .Site.Pages) 2000 }}
<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}">
{{ if not .Site.Params.ui.sidebar_search_disable }}
<form class="td-sidebar__search d-flex align-items-center">
{{ partial "search-input.html" . }}
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars" type="button" data-toggle="collapse" data-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
</button>
</form>
{{ end }}
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
<!-- {{ if (gt (len .Site.Home.Translations) 0) }}
<div class="nav-item dropdown d-block d-lg-none">
{{ partial "navbar-lang-selector.html" . }}
</div>
{{ end }} -->
{{ $currentLang := .Site.Language }}
{{ template "section-tree-nav-section" (dict "page" . "section" .FirstSection "delayActive" $shouldDelayActive "currentLang" $currentLang) }}
</nav>
</div>
{{ define "section-tree-nav-section" }}
{{ $s := .section }}
{{ $p := .page }}
{{ $shouldDelayActive := .delayActive }}
{{ $active := eq $p.CurrentSection $s }}
{{ $show := or (eq $s $p.FirstSection) (and (not $p.Site.Params.ui.sidebar_menu_compact) ($p.IsDescendant $s)) }}
{{ $sid := $s.RelPermalink | anchorize }}
<ul class="td-sidebar-nav__section pr-md-3">
<li class="td-sidebar-nav__section-title">
<a href="{{ $s.RelPermalink }}" class="align-left pl-0 pr-2{{ if not $show }} collapsed{{ end }}{{ if $active}} active{{ end }} td-sidebar-link td-sidebar-link__section">
{{ if not (eq $s.LinkTitle "Documentation") }}
{{ $s.LinkTitle }}
{{ end }}
</a>
</li>
<ul>
<li class="collapse {{ if $show }}show{{ end }}" id="{{ $sid }}">
{{ $pages := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true }}
{{ with site.Params.language_alternatives }}
{{ range . }}
{{ with (where $.section.Translations ".Lang" . ) }}
{{ $p := index . 0 }}
{{ $pages = $pages | lang.Merge (union $p.Pages $p.Sections) }}
{{ end }}
{{ end }}
{{ end }}
{{ $pages := $pages | first 50 }}
{{ range $pages }}
{{ if .IsPage }}
{{ $mid := printf "m-%s" (.RelPermalink | anchorize) }}
{{ $active := eq . $p }}
{{ $isForeignLanguage := (ne (string .Lang) (string $.currentLang)) }}
<a class="td-sidebar-link td-sidebar-link__page {{ if and (not $shouldDelayActive) $active }} active{{ end }}" id="{{ $mid }}" {{ if $isForeignLanguage }}target="_blank"{{ end }} href="{{ .RelPermalink }}">
{{ .LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .Lang | upper }})</small>{{ end }}
</a>
{{ else }}
{{ template "section-tree-nav-section" (dict "page" $p "section" . "currentLang" $.currentLang) }}
{{ end }}
{{ end }}
</li>
</ul>
</ul>
{{ end }}
-37
View File
@@ -1,37 +0,0 @@
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}" data-proofer-ignore></a>
{{ template "section-tree-nav" (dict "ctx" . "section" .) }}
{{ define "section-tree-nav" }}
{{ $pages := (union .section.Pages .section.Sections) }}
{{ with site.Params.language_alternatives }}
{{ range . }}
{{ with (where $.section.Translations ".Lang" . ) }}
{{ $p := index . 0 }}
{{ $pages = $pages | lang.Merge (union $p.Pages $p.Sections) }}
{{ end }}
{{ end }}
{{ end }}
{{ $sections := where $pages.ByWeight ".Params.toc_hide" "!=" true }}
{{ range $sections }}
{{ if .IsPage }}
{{ template "section-tree-nav-page" (dict "ctx" $.ctx "page" .) }}
{{ else }}
{{ template "section-tree-nav-section" (dict "ctx" $.ctx "section" .) }}
{{ end }}
{{ end }}
{{ end }}
{{ define "section-tree-nav-section" }}
<div class="item" data-title="{{ .section.LinkTitle }}">
<div class="container">
{{ if ge (len .section.Content) 10 }}
{{/* The section page has content, so link to it. */}}
{{ $isForeignLanguage := (ne .section.Lang $.ctx.Lang)}}
<a class="item" {{ if $isForeignLanguage }}target="_blank" {{ end }}data-title="{{ .section.LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .section.Lang | upper }})</small>{{ end }}" href="{{ .section.RelPermalink }}" data-proofer-ignore></a>
{{ end }}
{{ template "section-tree-nav" . }}
</div>
</div>
{{ end }}
{{ define "section-tree-nav-page" }}
{{ $isForeignLanguage := (ne .page.Lang $.ctx.Lang)}}
<a class="item" {{ if $isForeignLanguage }}target="_blank" {{ end }}data-title="{{ .page.LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .page.Lang | upper }})</small>{{ end }}" href="{{ .page.RelPermalink }}" data-proofer-ignore></a>
{{ end }}