Convert site to Hugo (#8316)

This commit converts content and layout to use Hugo.
This commit is contained in:
Bjørn Erik Pedersen
2018-05-05 18:00:51 +02:00
committed by k8s-ci-robot
parent 7745f0e0c5
commit 7f3b633aa0
2327 changed files with 10928 additions and 171503 deletions
+5
View File
@@ -0,0 +1,5 @@
{{ define "main" }}
<section>
<p>Sorry, this page was not found. :(</p>
</section>
{{ end }}
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html id="{{ .Params.cid }}" lang="en" class="{{ .Params.class }}">
<head>
{{ partial "head.html" . }}
</head>
<body>
{{ partialCached "header.html" . "default" }}
{{ block "hero" . }}
<!-- HERO -->
<section id="hero" class="light-text">
<main>
<div id="headlineWrapper">
<h1>{{ block "hero-title" . }}{{ .Params.bigheader | default .Title }}{{ end }}</h1>
<h5>{{ .Params.abstract }}</h5>
</div>
{{ block "hero-more" . }}{{ end }}
</main>
</section>
{{ block "post-hero" . }}{{ end }}
{{ end }}
{{ block "main" . }}{{ end }}
{{ partialCached "footer.html" . }}
{{ partialCached "footer-scripts.html" . }}
</body>
</html>
+3
View File
@@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}
+3
View File
@@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}
+38
View File
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html id="blog" lang="en" class="gr__kubernetes_io fontawesome-i2svg-active fontawesome-i2svg-complete">
<head>
{{ partial "head.html" . }}
<link rel='stylesheet' type='text/css' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<link rel="stylesheet" type="text/css" href="{{ "css/blog.css" | relURL }}">
</head>
<body>
{{ partialCached "header.html" . "blog" }}
<section id="hero" class="light-text no-sub">
<h1>Kubernetes Blog</h1>
</section>
<div class="container-fluid" style="padding-top: 2em">
<div class="row blog-content">
<div class="col-xs-10 col-sm-9 col-lg-9 text">
{{ block "main" . }}{{ end }}
</div>
<div class="col-xs-1 col-sm-1 col-sm-3 col-lg-3 text">
<div class="widget-content">
{{ 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 }}"> <i class="fas fa-rss fab-icon"> </i> </a>
{{ end -}}
<a class="widget-link" href="https://twitter.com/kubernetesio"> <i class="fab fa-twitter-square fab-icon"> </i> @Kubernetesio</a>
<a class="widget-link" href="https://github.com/kubernetes/kubernetes"> <i class="fab fa-github-square fab-icon"></i> View on Github </a>
<a class="widget-link" href="http://slack.k8s.io"><i class="fab fa-slack fab-icon"> </i> #kubernetes-users </a>
<a class="widget-link" href="http://stackoverflow.com/questions/tagged/kubernetes"><i class="fab fa-stack-overflow fab-icon"></i> Stack Overflow</a>
<a class="widget-link" href="http://get.k8s.io/"><i class="fab fa-stack-overflow fab-icon"></i> Download Kubernetes</a>
</div>
{{ partialCached "blog/archive.html" . }}
</div>
</div>
</div>
{{ partialCached "footer.html" . }}
{{ partialCached "footer-scripts.html" . }}
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
{{ define "main" }}
{{ range (.Paginator 1).Pages }}
{{ .Render "post" }}
{{ end }}
<div class="PageNavigation">
{{ template "_internal/pagination.html" . }}
</div>
{{ end }}
+12
View File
@@ -0,0 +1,12 @@
<div class="PageNavigation">
{{ if .PrevInSection }}
<div class="pagerButton left">
<h4><a class=" button" href="{{ .PrevInSection.RelPermalink }}"> « Prev </a></h4>
</div>
{{ end }}
{{ if .NextInSection }}
<div class="pagerButton right">
<h4><a class=" button" href="{{ .NextInSection.RelPermalink }}"> Next >></a></h4>
</div>
{{ end }}
</div>
+3
View File
@@ -0,0 +1,3 @@
<h4 class="date-header">{{ .Date.Format .Site.Params.time_format_blog }}</h4>
<h3 class="post-title entry-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
{{ .Content }}
+4
View File
@@ -0,0 +1,4 @@
{{ define "main" }}
{{ .Render "post" }}
{{ .Render "pager" }}
{{ end }}
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html id="{{ .Params.cid }}" lang="en" class="{{ .Params.class }}">
<head>
{{ partial "head.html" . }}
</head>
<body>
{{ partialCached "header.html" . "default" }}
{{ block "main" . }}{{ end }}
{{ partialCached "footer.html" . }}
{{ partialCached "footer-scripts.html" . }}
</body>
</html>
+3
View File
@@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}
+7
View File
@@ -0,0 +1,7 @@
{{ define "main" }}
{{ .Content }}
{{ end }}
{{ define "post-hero" }}
<a href="http://events.linuxfoundation.org/events/kubecon-and-cloudnativecon-europe"><img src="/images/KubeCon_EU_Community.jpg" alt="KubeConEU" width="100%" align="center"></a>
{{ end }}
+45
View File
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html id="docs" lang="en" class="{{ .Params.class }}">
<head>
{{ partial "head.html" . }}
</head>
<body>
{{ partialCached "header.html" . "docs" }}
{{ block "hero" . }}
<!-- HERO -->
<section id="hero" class="light-text no-sub">
{{ partial "docs/top-menu.html" . }}
</section>
{{ end }}
{{ block "deprecation" . }}{{ partial "deprecation-warning.html" . }}{{ end }}
<section id="encyclopedia">
{{ block "side-menu" . }}<div id="docsToc" style="display:none;"></div>{{ end }}
<div id="{{ block "content-id" . }}docsContent{{ end }}">
{{ block "content" . }}{{ end }}
<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>
{{ 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?title=Issue%20with%20' +
'k8s.io'+window.location.pathname)" class="button issue">Create an Issue</a>
{{ end }}
{{ end }}
{{ if not .Params.noedit }}
<a href="{{ printf "%s#%s" ("docs/editdocs" | relURL) .Path | safeURL }}" class="button issue">Edit this Page</a>
{{ end }}
</div>
</div>
</section>
{{ partialCached "footer.html" . }}
{{ partialCached "footer-scripts.html" . }}
</body>
</html>
+12
View File
@@ -0,0 +1,12 @@
{{ define "content" }}
{{ if not .Params.notitle }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ .Content }}
{{ if .Params.track }}
{{ partial "docs/user-journey.html" . }}
{{ end }}
{{ end }}
{{ define "content-id" }}content{{ end }}
+96
View File
@@ -0,0 +1,96 @@
{{ define "content" }}
{{ if not .Params.notitle }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ template "docs-portal-user-journey" . }}
{{ partial "docs/browse.html" (where .Parent.Sections ".Params.toc_hide" "!=" true) }}
{{ end }}
{{ define "content-id" }}content{{ end }}
{{ define "docs-portal-user-journey" }}
{{ $data := .Site.Data }}
<div id="user-persona-data" class="hide">
{{ $user_personas := index $data "user-personas" }}
{{ $user_personas | jsonify }}
</div>
<div class="hide">
{{ $skip_uj_paths := "migrators" }}
{{ range $k, $v := $user_personas }}
{{ if strings.Contains $skip_uj_paths $k }}
{{ else }}
{{ range $kk, $vv := $v }}
<div class="persona-def-data" data-name="{{ $kk }}">
{{ $persona_info := $vv }}
{{ if $persona_info.short_desc }}
{{ $persona_info.short_desc }}
{{ end }}
</div>
{{ end }}
{{ end }}
{{ end }}
</div>
<div id='aboutWrapper'>
<div class="aboutsection" markdown="1">
Kubernetes is an open source system for managing <a href="https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/">containerized applications</a> across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.
The open source project is hosted by the Cloud Native Computing Foundation (<a href="https://www.cncf.io/about">CNCF</a>).
<div class="aboutcolumn" markdown="1">
<a href="{{ "docs/imported/release/notes/" | relURL }}">Download Current Release</a>
</div>
<div class="aboutcolumn" markdown="1">
<a href="{{ "docs/home/supported-doc-versions/" | relURL }}">Supported Doc Versions</a>
</div>
</div>
</div>
<div class="paths">
<div class="navButton users">Users</div>
<div class="navButton contributors">Contributors</div>
<a> <div class="navButton browse">Browse Docs</div></a>
</div>
<div id="cardWrapper">
<div class="display-bar">I AM...</div>
<div class='cards' markdown="1">
<div class='docsection1' id='persona-definition'>.</div>
</div>
</div>
<div style='text-align: center;' class="applicationDeveloperContainer">
<div class="display-bar" id="subTitle">LEVEL</div>
<div class="levels">
<div class="level" data-name="foundational">
<i class="fa fa-sign-in" aria-hidden="true" style="font-size:50pt !important;padding-top:7% !important;padding-bottom:15% !important"></i>
<br>
<div class="tabbottom" style="padding-top:5%;padding-bottom:5%">
Foundational
</div>
</div>
<div class="level" data-name="intermediate">
<i class="fa fa-university" aria-hidden="true" style="font-size:50pt !important;padding-top:7% !important;padding-bottom:15% !important"></i>
<br>
<div class="tabbottom" style="padding-top:5%;padding-bottom:5%">
Intermediate
</div>
</div>
<div class="level" data-name="advanced">
<i class="fa fa-magic" aria-hidden="true" style="font-size:50pt !important;padding-top:7% !important;padding-bottom:15% !important"></i>
<br>
<div class="tabbottom" style="padding-top:5%;padding-bottom:5%">
Advanced Topics
</div>
</div>
</div>
</div>
<div class='infobarWrapper'>
<div class="infobar">
<span style="padding-bottom: 3% ">I want to...</span>
<div id="infobarLinks"></div>
</div>
</div>
{{ end }}
+56
View File
@@ -0,0 +1,56 @@
{{ define "side-menu" }}
{{ partial "docs/side-menu.html" . }}
{{ end }}
{{ define "content" }}
<h1>{{ .Title }}</h1>
<link href="{{ "css/glossary.css" | relURL }}" rel="stylesheet">
<script src="{{ "js/glossary.js" | relURL }}"></script>
<p>This glossary is intended to be a comprehensive, standardized list of Kubernetes terminology. It includes technical terms that are specific to K8s, as well as more general terms that provide useful context.</p>
<div id="tag-container">
<p>Filter terms according to their tags:</p>
<div class="tag-description invisible" id="placeholder">.</div>
{{ range (index .Site.Data "canonical-tags") }}
<div class="tag-description hide" id="{{ printf "tag-%s-description" .id }}">
<i>{{ .description }}</i>
</div>
{{ end }}
{{ $sorted_tags := sort (index .Site.Data "canonical-tags") "name" }}
{{ range $sorted_tags }}
{{ $full_tag_name := printf "tag-%s" .id }}
<span id="{{ $full_tag_name }}" class="tag-option canonical-tag" data-target="{{ $full_tag_name }}">
<a href="javascript:void(0)">{{ .name }}</a>
</span>
{{ end }}
<span class="tag-option"><a id="select-all-tags" href="javascript:void(0)">Select all</a></span>
<span class="tag-option"><a id="deselect-all-tags" href="javascript:void(0)">Deselect all</a></span>
</div>
<p>Click on the <a href="javascript:void(0)" class="no-underline">[+]</a> indicators below to get a longer explanation for any particular term.</p>
{{ $glossary_terms := (.Site.GetPage "page" "docs/reference/glossary").Resources.ByType "page" }}
{{ $glossary_terms := sort $glossary_terms "Title" "asc" }}
<ul>
{{ range $glossary_terms }}
{{ $.Scratch.Set "tag_classes" "" }}
{{ range .Params.tags }}
{{ $.Scratch.Add "tag_classes" (printf "tag-%s " .) }}
{{ end }}
{{ $term_identifier := (printf "term-%s" .Params.id) }}
<li class="{{ $.Scratch.Get "tag_classes" }} hide" data-show-count="0">
<div id="{{ $term_identifier }}" class="term-anchor"></div>
<div>
<div class="term-name"><b>{{ .Title }}</b><a href="{{ printf "#%s" $term_identifier }}" class="permalink hide">LINK</a></div>
{{ with .Params.aka }}
Also known as: <i>{{ delimit . ", " }}</i>
<br>
{{ end }}
<span class="preview-text">{{ .Summary }} <a href="javascript:void(0)" class="click-controller no-underline" data-target="{{ .Params.id }}">[+]</a></span>
<div id="{{ .Params.id }}" class="hide">
{{ .Content | strings.TrimPrefix .Summary | safeHTML }}
</div>
</div>
</li>
{{ end }}
</ul>
{{ end }}
+13
View File
@@ -0,0 +1,13 @@
{{ define "content" }}
{{ with .Content }}
{{ partial "docs/content_page" (dict "ctx" $ "page" $) }}
{{ else }}
{{ if ge (len .Pages) 1 }}
{{ $page := index .Pages 0 }}
{{ partial "docs/content_page" (dict "ctx" $ "page" $page) }}
{{ end }}
{{ end }}
{{ end }}
{{ define "side-menu" }}
{{ partial "docs/side-menu.html" . }}
{{ end }}
+25
View File
@@ -0,0 +1,25 @@
{{ define "content" }}
<h1>{{ .Title }}</h1>
<script type="text/javascript">
document.write('<gcse:searchresults-only linktarget="_parent"></gcse:searchresults-only>');
</script>
<script>
(function() {
var cx = '013288817511911618469:elfqqbqldzg';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
document.querySelector('html').classList.add('search');
})();
</script>
{{ end }}
+8
View File
@@ -0,0 +1,8 @@
{{ define "content" }}
{{ partial "docs/content_page" (dict "ctx" . "page" .) }}
{{ end }}
{{ define "side-menu" }}
{{ partial "docs/side-menu.html" . }}
{{ end }}
+10
View File
@@ -0,0 +1,10 @@
{{ define "main" }}
{{ .Content }}
{{ end }}
{{ define "hero-more" }}
{{ with .Site.GetPage "section" "docs/tutorials/kubernetes-basics" }}
<a href="{{ .RelPermalink }}" id="quickstartButton" class="button">{{ .LinkTitle }}</a>
{{ end }}
{{ end }}
+38
View File
@@ -0,0 +1,38 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title }} {{ .Title }}</title>
<link>{{ .Permalink }}</link>
<description>Recent Hugo news from gohugo.io</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
<image>
<url>{{ "img/hugo.png" | absURL }}</url>
<title>GoHugo.io</title>
<link>{{ .Permalink }}</link>
</image>
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range first 50 (where .Site.RegularPages "Type" "in" (slice "blog")) }}
<item>
<title>{{ .Section | title }}: {{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
{{ with $img }}
{{ $img := .Resize "640x" }}
{{ printf "<![CDATA[<img src=\"%s\" width=\"%d\" height=\"%d\"/>]]>" $img.Permalink $img.Width $img.Height | safeHTML }}
{{ end }}
{{ .Content | html }}
</description>
</item>
{{ end }}
</channel>
</rss>
+21
View File
@@ -0,0 +1,21 @@
<div class="panel-group" id="blog-archive">
{{ range $i, $e := .CurrentSection.Pages.GroupByPublishDate "2006" }}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#archive" href="#collapse-{{ .Key }}">
{{ .Key }}</a>
</h4>
</div>
<div id="collapse-{{ .Key }}" class="panel-collapse collapse{{ if eq $i 0 }} in{{ end }}">
<div class="panel-body">
<ul class="list-group">
{{ range .Pages }}
<li class="list-group-item"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a> <span class="date">{{ .PublishDate.Format "Jan 2" }}</span> </li>
{{ end }}
</ul>
</div>
</div>
</div>
{{ end }}
</div>
+12
View File
@@ -0,0 +1,12 @@
{{ if .Param "deprecated" }}
<section id="deprecationWarning">
<main>
<div class="content deprecation-warning">
<h3>
Documentation for Kubernetes {{ .Param "version" }} is no longer actively maintained. The version you are currently viewing is a static snapshot.
For up-to-date documentation, see the <a href="{{ .Site.Params.currentUrl }}">latest</a> version.
</h3>
</div>
</main>
</section>
{{ end }}
+39
View File
@@ -0,0 +1,39 @@
<div id='browsedocsWrapper'>
<div class="browseheader" id="browsedocs">
<a name="browsedocs">Browse Docs</a>
</div>
<div class="browsedocs">
{{ range . }}
{{ template "docs-browse-section" . }}
{{ end }}
</div><!-- end browsedocs -->
{{ define "docs-browse-section" }}
<div class="browsesection">
<div class="docstitle">
<h3><a href="{{ .RelPermalink }}">{{ .Params.bigheader | default .Title }}</a></h3>
</div>
{{ $pages := .Pages | union .Sections }}
{{ $pages := where $pages ".Params.toc_hide" "!=" true }}
{{ if ge (len $pages) 1 }}
<div class="pages">
{{ $num_pages := len $pages }}
{{ if gt $num_pages 0 }}
{{ $column_size := (div $num_pages 3) | math.Ceil | int | default 1 }}
{{ range $i, $e := $pages.ByWeight }}
{{ $offset := mod $i $column_size | add 1 }}
{{ if eq $offset 1 }}
<div class="browsecolumn">
{{ end }}
<a href="{{ .RelPermalink }}">{{ printf "%02d - %s" (add $i 1) .LinkTitle }}</a><br>
{{ if or (eq $offset $column_size) (eq (add $i 1) $num_pages)}}
</div>
{{ end }}
{{ end }}
{{ end }}
</div><!-- end pages -->
{{ end }}
</div><!-- end browsesection -->
{{ end }}
+12
View File
@@ -0,0 +1,12 @@
<p><a href="{{ printf "%s#%s" ("docs/editdocs" | relURL) .page.Path | safeURL }}" id="editPageButton">Edit This Page</a></p>
{{ if not .page.Params.notitle }}
<h1>{{ .page.Title }}</h1>
{{ end }}
{{ with .page.Params.content_template }}
{{ partial . $ }}
{{ else }}
{{ if and (not .page.Params.toc_hide) (not (.page.HasShortcode "toc")) }}
{{ .page.TableOfContents }}
{{ end }}
{{ .page.Content }}
{{ end }}
+24
View File
@@ -0,0 +1,24 @@
<div id="docsToc">
<div class="pi-accordion">
{{/* This can be any page in the docs tree. Need to find the correct ancestor.
In a roundabout way. This will improve when Go templates gets assignment and break support (both in Go 1.11).
*/}}
{{ $p := . }}
{{ .Scratch.Set "section" .CurrentSection }}
{{ .Scratch.Set "sectionFound" false }}
{{ $docs := .Site.GetPage "section" "docs" }}
{{ if ne .CurrentSection $docs }}
{{ range $docs.Sections }}
{{ if not ($.Scratch.Get "sectionFound") }}
{{ if $p.IsDescendant . }}
{{ $.Scratch.Set "section" . }}
{{ $.Scratch.Set "sectionFound" true }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ $section := (.Scratch.Get "section") }}
{{ partialCached "tree.html" $section $section.RelPermalink }}
</div> <!-- /pi-accordion -->
<button class="push-menu-close-button" onclick="kub.toggleToc()"></button>
</div> <!-- /docsToc -->
+21
View File
@@ -0,0 +1,21 @@
{{ $p := . }}
{{ $home := .Site.Home }}
{{ $docs := .Site.GetPage "section" "docs" }}
{{ $menuSections := (where $docs.Sections ".Params.main_menu" true) }}
{{ range $menuSections }}
{{ if $p.IsDescendant . }}
<h1>{{ if not (strings.Contains .Dir "home")}}{{ .Params.bigheader | default .Title }}{{ end }}</h1>
<h5>{{ .Params.abstract }}</h5>
{{ end }}
{{ end }}
<div id="vendorStrip" class="light-text">
<ul>
{{ range $menuSections }}
{{ $yah := $p.IsDescendant . }}
<li><a href="{{ .RelPermalink }}"{{ if $yah }} class="YAH"{{ end }}>{{ .LinkTitle | upper }}</a></li>
{{ end }}
</ul>
<div id="searchBox">
<input type="text" id="search" placeholder="Search" onkeydown="if (event.keyCode==13) window.location.replace('/docs/search/?q=' + this.value)" autofocus="autofocus">
</div>
</div>
+22
View File
@@ -0,0 +1,22 @@
<div class="track">{{ .Params.track }}</div>
<div class="topheader">
Introduction
</div>
<div class="sections">sections in this doc</div>
<div id="user-journeys-toc" class="tablebar">
<!-- This TOC section is populated with Javascript, see js/user-journeys-toc.js -->
</div>
<div class="docsection1">
{{ partial "insert-capture" (dict "ctx" . "id" "overview" )}}
{{- with .Scratch.Get "__cid_body" -}}
{{ $body := replace . `<h2` `</div><h2` }}
{{ $body := replace $body `</h2>` `</h2><div class="docsection1">` | safeHTML }}
{{- $body -}}
{{- end -}}
</div>
<script src="{{ "js/user-journeys/toc.js" | relURL }}"></script>
+42
View File
@@ -0,0 +1,42 @@
<button class="flyout-button" onclick="kub.toggleToc()"></button>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36037335-10', 'auto');
ga('send', 'pageview');
// hide docs nav area if no nav is present, or if nav only contains a link to the current page
(function () {
window.addEventListener('DOMContentLoaded', init)
// play nice with our neighbors
function init() {
window.removeEventListener('DOMContentLoaded', init)
hideNav()
}
function hideNav(toc){
if (!toc) toc = document.querySelector('#docsToc')
if (!toc) return
var container = toc.querySelector('.container')
// container is built dynamically, so it may not be present on the first runloop
if (container) {
if (container.childElementCount === 0 || toc.querySelectorAll('a.item').length === 1) {
toc.style.display = 'none'
document.getElementById('docsContent').style.width = '100%'
}
} else {
requestAnimationFrame(function () {
hideNav(toc)
})
}
}
})();
</script>
<!-- Commenting out AnswerDash for now; we need to work on our list of questions/answers/design first
<!-- Start of AnswerDash script <script>var AnswerDash;!function(e,t,n,s,a){if(!t.getElementById(s)){var i,r=t.createElement(n),c=t.getElementsByTagName(n)[0];e[a]||(i=e[a]=function(){i.__oninit.push(arguments)},i.__oninit=[]),r.type="text/javascript",r.async=!0,r.src="https://p1.answerdash.com/answerdash.min.js?siteid=756",r.setAttribute("id",s),c.parentNode.insertBefore(r,c)}}(window,document,"script","answerdash-script","AnswerDash");</script> <!-- End of AnswerDash script -->
+33
View File
@@ -0,0 +1,33 @@
<footer>
<main class="light-text">
<nav>
{{ with $.Site.GetPage "page" "docs/tutorials/stateless-application/hello-minikube" }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
{{ $sections := slice "docs/home" "blog" "partners" "community" "case-studies" }}
{{ range $sections }}
{{ with $.Site.GetPage "section" . }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
{{ end }}
</nav>
<div class="social">
<div>
<a href="https://twitter.com/kubernetesio" class="twitter"><span>twitter</span></a>
<a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
<a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
</div>
<div>
<a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
<a href="https://groups.google.com/forum/#!forum/kubernetes-users" class="mailing-list"><span>Mailing List</span></a>
<a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
</div>
<div>
<a href="/docs/setup/pick-right-solution/" class="button">Get Kubernetes</a>
<a href="https://github.com/kubernetes/kubernetes" class="button">Contribute</a>
</div>
</div>
<div id="miceType" class="center">
&copy; {{ now.Year }} The Kubernetes Authors | Documentation Distributed under <a href="https://git.k8s.io/website/LICENSE" class="light-text">CC BY 4.0</a>
</div>
<div id="miceType" class="center">
Copyright &copy; {{ now.Year }} The Linux Foundation&reg;. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text">Trademark Usage page</a>
</div>
</main>
</footer>
+35
View File
@@ -0,0 +1,35 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="{{ "images/favicon.png" | relURL }}">
<link rel="stylesheet" type="text/css" href="/css/base_fonts.css">
{{ if .Params.case_study_styles }}<link rel="stylesheet" type="text/css" href="{{ "css/case_study_styles.css" | relURL }}"><!-- custom case_study_styles on -->{{ else }}<link rel="stylesheet" type="text/css" href="{{ "css/styles.css" | relURL }}"><!-- default styles.css on -->{{ end }}
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<link rel="stylesheet" type="text/css" href="{{ "css/callouts.css" | relURL }}">
<link rel="stylesheet" type="text/css" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
{{ if .Params.deprecated }}<link rel="stylesheet" type="text/css" href="{{ "css/deprecation-warning.css" | relURL }}">{{ end }}
{{ if eq .Params.class "gridPage" }}<link rel="stylesheet" type="text/css" href="{{ "css/gridpage.css" | relURL }}">{{ end }}
{{ with .Params.css }}{{ range (split . ",") }}<link rel="stylesheet" type="text/css" href="{{ (trim . " ") | relURL }}"><!-- custom css added -->
{{ end }}{{ else }}<!-- no custom css detected -->{{ end }}
{{ if .Params.description }}
<meta name="description" content="{{ .Params.description }}" />
{{ else }}
<meta name="description" content="{{ .Params.title }}" />
{{ end }}
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<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 }}
</head>
+79
View File
@@ -0,0 +1,79 @@
<div id="cellophane" onclick="kub.toggleMenu()"></div>
<header>
<a href="/" class="logo"></a>
<div class="nav-buttons" data-auto-burger="primary">
<ul class="global-nav">
{{ $sections := slice "docs/home" "blog" "partners" "community" "case-studies" }}
{{ range $sections }}
{{ with $.Site.GetPage "section" . }}<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>{{ end }}
{{ end }}
{{ $home := .Site.Home }}
<li>
<a href="#">
{{ $home.Language.LanguageName }} <span class="ui-icon ui-icon-carat-1-s"></span>
</a>
<ul>
{{ range $home.Translations }}
<li><a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
</li>
<li>
<a href="#">
{{ .Site.Params.version }} <span class="ui-icon ui-icon-carat-1-s"></span>
</a>
<ul>
{{ range .Site.Params.versions }}
<li><a href="{{ .url }}">{{ .version }}</a></li>
{{ end }}
</ul>
</li>
</ul>
<!-- <a href="/docs/home" class="button" id="viewDocs" data-auto-burger-exclude>View Documentation</a> -->
<a href="/docs/tutorials/kubernetes-basics/" class="button" id="tryKubernetes" data-auto-burger-exclude>Try Kubernetes</a>
<button id="hamburger" onclick="kub.toggleMenu()" data-auto-burger-exclude><div></div></button>
</div>
<nav id="mainNav">
<main data-auto-burger="primary">
<div class="nav-box">
<h3><a href="/docs/tutorials/stateless-application/hello-minikube/">Get Started</a></h3>
<p>Ready to get your hands dirty? Build a simple Kubernetes cluster that runs "Hello World" for Node.js.</p>
</div>
<div class="nav-box">
<h3><a href="/docs/home/">Documentation</a></h3>
<p>Learn how to use Kubernetes with the use of walkthroughs, samples, and reference documentation. You can even <a href="/editdocs/" data-auto-burger-exclude>help contribute to the docs</a>!</p>
</div>
<div class="nav-box">
<h3><a href="/community/">Community</a></h3>
<p>If you need help, you can connect with other Kubernetes users and the Kubernetes authors, attend community events, and watch video presentations from around the web.</p>
</div>
<div class="nav-box">
<h3><a href="/blog/">Blog</a></h3>
<p>Read the latest news for Kubernetes and the containers space in general, and get technical how-tos hot off the presses.</p>
</div>
</main>
<main data-auto-burger="primary">
<div class="left">
<h5 class="github-invite">Interested in hacking on the core Kubernetes code base?</h5>
<a href="https://github.com/kubernetes/kubernetes" class="button" data-auto-burger-exclude>View On Github</a>
</div>
<div class="right">
<h5 class="github-invite">Explore the community</h5>
<div class="social">
<a href="https://twitter.com/kubernetesio" class="twitter"><span>Twitter</span></a>
<a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
<a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
<a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
<a href="https://groups.google.com/forum/#!forum/kubernetes-users" class="mailing-list"><span>Mailing List</span></a>
<a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
</div>
</div>
<div class="clear" style="clear: both"></div>
</main>
</nav>
</header>
+4
View File
@@ -0,0 +1,4 @@
{{- $capture_id := printf "__cid_%s" .id -}}
{{- with .ctx.Scratch.Get $capture_id -}}
{{- . -}}
{{- end -}}
+14
View File
@@ -0,0 +1,14 @@
{{/* We need to initialize the shortcode's page's content. This is a very special construct. We are building page blocks by setting state on the Page,
but we are not accessing its content. The .Content is lazily loaded in Hugo, so we must invoke that method before we do anything else. */}}
{{ if .page.Content }}{{ end }}
{{- $capture := printf "__cid_%s" .block -}}
{{- $block := .page.Scratch.Get $capture -}}
{{- if and (not $block) (not $.optional) -}}
{{ partial "templates/errorthrower.html" (dict "block" .block "heading" .heading "purpose" .purpose) . }}
{{- end -}}
{{- with $block -}}
{{- with $.heading }}
<h2 id="{{ . | anchorize }}">{{ . }}</h2>
{{ end -}}
{{ . }}
{{ end -}}
+20
View File
@@ -0,0 +1,20 @@
{{ .ctx.Scratch.Set "sections" slice }}
<ul id="markdown-toc">
{{ range .ctx.Scratch.Get "blocks" }}
{{ if .content }}
{{ $.ctx.Scratch.Set "section" .content }}
{{ else}}
{{ $.ctx.Scratch.Set "section" (partial "templates/block" .) }}
{{ end }}
{{ $section := $.ctx.Scratch.Get "section" }}
{{ $headers := findRE "<h2.*?>(.|\n)*?</h2>" $section }}
{{ range $headers }}
{{ $header := . | replaceRE "</?h2.*?>" "" | htmlUnescape }}
<li><a href="#{{ $header | anchorize }}">{{ $header }}</a></li>
{{ end }}
{{ $.ctx.Scratch.Add "sections" $section }}
{{ end }}
</ul>
{{ range .ctx.Scratch.Get "sections" }}
{{ . }}
{{ end }}
+8
View File
@@ -0,0 +1,8 @@
{{ partial "templates/block" (dict "page" .page "block" "overview" "purpose" "states, in one or two sentences, the purpose of this document") }}
{{ .ctx.Scratch.Set "blocks" slice }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "body" "purpose" "supplies the body of the page content.") }}
{{ .ctx.Scratch.Add "blocks" (dict "content" .page.Content) }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "whatsnext" "heading" "What's next" "optional" true ) }}
{{ partial "templates/blocks" . }}
@@ -0,0 +1,14 @@
<h2>ERROR</h2>
<p>You must define a <span style="font-family: monospace">{{ .block }}</span></p>
<p>This template requires that you provide text that {{ .purpose }}. The text in this block will
be displayed under the heading <b>{{ .heading }}</b>.
To get rid of this message and take advantage of this template, capture the <i>{{ .block }}</i> variable and populate it with content.
<!-- TEMPLATE_ERROR -->
</p>
@@ -0,0 +1,29 @@
<a href="#" id="feature-state-dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>{{ .page.Title }}</a>
<div id="feature-state-dialog" class="ui-dialog-content" title="{{ .page.Title }}">
{{ .page.Content | markdownify }}
</div>
<script>
$(function(){
$( "#feature-state-dialog" ).dialog({
autoOpen: false,
width: {{ .width | default "600" }},
buttons: [
{
text: "Ok",
click: function() {
$( this ).dialog( "close" );
}
}
]
});
// Link to open the dialog
$( "#feature-state-dialog-link" ).click(function( event ) {
$( "#feature-state-dialog" ).dialog( "open" );
event.preventDefault();
});
});
</script>
@@ -0,0 +1,21 @@
<div style="margin-top: 10px; margin-bottom: 10px;">
{{ $for_k8s_version := .for_k8s_version | default (.page.Param "version") }}
{{ $width := .width | default "600" }}
{{ $state := .state }}
<b>FEATURE STATE:</b> <code>Kubernetes {{ $for_k8s_version }}</code>
{{/* docs/templates is a Hugo page bundle */}}
{{ $templates_path := "docs/templates" }}
{{ $templates := .page.Site.GetPage "page" $templates_path }}
{{ with $templates.Resources }}
{{ $template_path := printf "**feature-state-%s*" $state }}
{{ $content_template := .GetMatch $template_path }}
{{ with $content_template }}
{{ $dialog := dict "page" $content_template "for_k8s_version" $for_k8s_version "width" $width }}
{{ partial "templates/feature-dialog.html" $dialog }}
{{ else }}
{{ errorf "[%s] template not found in %s" .page.Site.Language.Lang $template_path }}
{{ end }}
{{ else }}
{{ errorf "[%s] templates not found in docs/templates" .page.Site.Language.Lang }}
{{ end }}
</div>
+11
View File
@@ -0,0 +1,11 @@
{{ partial "templates/block" (dict "page" .page "block" "overview" "purpose" "states, in one or two sentences, the purpose of this document") }}
{{ .ctx.Scratch.Set "blocks" slice }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "prerequisites" "heading" "Before you begin" "purpose" "lists action prerequisites and knowledge prerequisites.") }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "steps" "purpose" "lists a sequence of numbered steps that accomplish the task.'") }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "discussion" "optional" true ) }}
{{ .ctx.Scratch.Add "blocks" (dict "content" .page.Content) }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "whatsnext" "heading" "What's next" "optional" true ) }}
{{ partial "templates/blocks" . }}
+12
View File
@@ -0,0 +1,12 @@
{{ partial "templates/block" (dict "page" .page "block" "overview" "purpose" "states, in one or two sentences, the purpose of this document") }}
{{ .ctx.Scratch.Set "blocks" slice }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "objectives" "heading" "Objectives" "purpose" "lists the objectives for this tutorial.") }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "prerequisites" "heading" "Before you begin" "purpose" "lists action prerequisites and knowledge prerequisites.") }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "lessoncontent" "purpose" "provides the lesson content for this tutorial.") }}
{{ .ctx.Scratch.Add "blocks" (dict "content" .page.Content) }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "cleanup" "heading" "Cleaning up" "optional" true ) }}
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "whatsnext" "heading" "What's next" "optional" true ) }}
{{ partial "templates/blocks" . }}
@@ -0,0 +1,23 @@
<div class="track">{{ .Params.track }}</div>
<div class="topheader">
Introduction
</div>
<div class="sections">sections in this doc</div>
<div id="user-journeys-toc" class="tablebar">
<!-- This TOC section is populated with Javascript, see js/user-journeys-toc.js -->
</div>
<div class="docsection1">
{{ partial "templates/block" (dict "page" . "block" "overview" "purpose" "provides an introduction of this level.") }}
{{- $capture := printf "__cid_%s" "body" -}}
{{- $body := .Scratch.Get $capture -}}
{{ with $body }}
{{ $b := replace $body "<h2" "</div><h2" }}
{{ $b := replace $b "</h2>" "</h2><div class=\"docsection1\"" }}
{{ $b }}
{{ end }}
</div>
<script src="{{ "js/user-journeys/toc.js" | relURL }}"></script>
+25
View File
@@ -0,0 +1,25 @@
{{ $section := . }}
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
{{ template "section-tree-nav-pages" . }}
{{ template "section-tree-nav" $section }}
{{ define "section-tree-nav" }}
{{ $sections := where .Sections ".Params.toc_hide" "!=" true }}
{{ range $sections }}
<div class="item" data-title="{{ .LinkTitle }}">
<div class="container">
{{ if ge (len .Content) 10 }}
{{/* The section page has content, so link to it. */}}
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
{{ end }}
{{ template "section-tree-nav-pages" . }}
{{ template "section-tree-nav" . }}
</div>
</div>
{{ end }}
{{ end }}
{{ define "section-tree-nav-pages" }}
{{ range where .Pages ".Params.toc_hide" "!=" true }}
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
{{ end }}
{{ end }}
+9
View File
@@ -0,0 +1,9 @@
User-agent: *
Disallow: /legacy/
Disallow: /v1.0/
Disallow: /v1.1/
Disallow: /404/
Disallow: 404.html
SITEMAP: {{ "sitemap.xml" | absLangURL }}
+6
View File
@@ -0,0 +1,6 @@
{{- $id := .Get 0 -}}
{{- if not $id -}}
{{- errorf "missing id in capture" -}}
{{- end -}}
{{- $capture_id := printf "__cid_%s" $id -}}
{{- .Page.Scratch.Set $capture_id .Inner -}}
+3
View File
@@ -0,0 +1,3 @@
<blockquote class="caution">
<div>{{ .Inner | markdownify }}</div>
</blockquote>
+38
View File
@@ -0,0 +1,38 @@
{{ $p := .Page }}
{{ $file := .Get "file" }}
{{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
{{ $fileDir := path.Split $file }}
{{ $bundlePath := path.Join .Page.Dir $fileDir.Dir }}
{{ $filename := path.Join $p.Dir $file }}
{{ $ghlink := printf "https://%s/blob/master/content/%s/%s" .Page.Site.Params.githubWebsiteRepo .Page.Lang $filename | safeURL }}
{{/* First assume this is a bundle and the file is inside it. */}}
{{ $resource := $p.Resources.GetMatch (printf "%s*" $file ) }}
{{ with $resource }}
{{ $.Scratch.Set "content" .Content }}
{{ else }}
{{/* Read the file relative to the content root. */}}
{{ $resource := readFile $filename}}
{{ with $resource }}{{ $.Scratch.Set "content" . }}{{ end }}
{{ end }}
{{ if not ($.Scratch.Get "content") }}
{{ errorf "[%s] %q not found in %q" $p.Site.Language.Lang $fileDir.File $bundlePath }}
{{ end }}
{{ with $.Scratch.Get "content" }}
<table class="includecode" id="{{ $file | anchorize }}">
<thead>
<tr>
<th>
{{ with $ghlink }}<a href="{{ . }}" download="{{ $file }}">{{ end }}
<code>{{ $file }} {{ $bundlePath }}</code>
{{ if $ghlink }}</a>{{ end }}
<img src="{{ "images/copycode.svg" | relURL }}" style="max-height:24px" onclick="copyCode('{{ $file | anchorize }}')" title="Copy {{ $file }} to clipboard">
</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ highlight . $codelang "" }} </td>
</tr>
</tbody>
</table>
{{ end }}
+1
View File
@@ -0,0 +1 @@
{{ if .Inner}}{{ end }}
@@ -0,0 +1,12 @@
{{ if .Page.Param "deprecated" }}
<section id="deprecationWarning">
<main>
<div class="content deprecation-warning">
<h3>
Documentation for Kubernetes {{ .Page.Param "version" }} is no longer actively maintained. The version you are currently viewing is a static snapshot.
For up-to-date documentation, see the <a href="{{ .Params.currentUrl }}">latest</a> version.
</h3>
</div>
</main>
</section>
{{ end }}
+10
View File
@@ -0,0 +1,10 @@
{{ $valid_states := "alpha, beta, deprecated, stable" }}
{{ $state := .Get "state" }}
{{ $for_k8s_version := .Get "for_k8s_version" }}
{{ $width := .Get "width" }}
{{ $is_valid := strings.Contains $valid_states $state }}
{{ if not $is_valid }}
{{ errorf "%q is not a valid feature-state, use one of %q" $valid_states }}
{{ else }}
{{ partial "templates/feature-state.html" (dict "ctx" . "page" .Page "state" $state "for_k8s_version" $for_k8s_version "width" $width) }}
{{ end }}
@@ -0,0 +1,29 @@
{{- $id := .Get "term_id" -}}
{{- $length := .Get "length" -}}
{{- $prepend := .Get "prepend" }}
{{- $glossaryBundle := .Site.GetPage "page" "docs/reference/glossary" -}}
{{- $glossaryItems := $glossaryBundle.Resources.ByType "page" -}}
{{- $term_info := $glossaryItems.GetMatch (printf "%s*" $id ) -}}
{{- if not $term_info -}}
{{- errorf "[%s] %q: %q is not a valid glossary term_id, see ./docs/reference/glossary/* for a full list" .Page.Site.Language.Lang .Page.Path $id -}}
{{- end -}}
{{- with $term_info -}}
{{- if (strings.Contains "short" $length) -}}
{{- with .Summary -}}
{{- if $prepend }}{{- replace . "<p>" (printf "<P>%s %s" $prepend .) -}}{{ else }}{{- . -}}{{ end -}}
{{- else -}}
{{- partial "templates/errorthrower.html" (dict "block" "summary" "purpose" .purpose "describes the key term in greater depth, supplementing the short-description") . -}}
{{- end -}}
{{- end -}}
{{- if (strings.Contains "all|long" $length) -}}
{{- with .Content -}}
{{- if $prepend }}
{{- $firstPara := index (findRE "(?s)<p>.*?</p>" . 1) 0 -}}
{{- $firstPara := $firstPara | strings.TrimSuffix "</p>" | strings.TrimPrefix "<p>" -}}
{{- $first := slicestr $firstPara 0 1 | lower }}
{{- $prepended := printf "<p>%s %s%s</p>" $prepend $first (slicestr $firstPara 1) -}}
{{- replace . $firstPara $prepended | safeHTML -}}{{ else }}{{- . -}}{{ end -}}
{{- end -}}
{{- end -}}
{{- end -}}
+22
View File
@@ -0,0 +1,22 @@
{{- $id := .Get "term_id" -}}
{{- $text := .Get "text" -}}
{{- $glossaryBundle := .Site.GetPage "page" "docs/reference/glossary" -}}
{{- $glossaryItems := $glossaryBundle.Resources.ByType "page" -}}
{{- $term_info := $glossaryItems.GetMatch (printf "%s*" $id ) -}}
{{- if not $term_info -}}
{{- errorf "[%s] %q: %q is not a valid glossary term_id, see ./docs/reference/glossary/* for a full list" .Page.Site.Language.Lang .Page.Path $id -}}
{{- end }}
{{- with $term_info -}}
{{- $text := $text | default $term_info.Title -}}
{{- $glossary_home := "docs/reference/glossary/?all=true" | relLangURL -}}
{{- $external_link := $term_info.Params.full_link | default (printf "%s#term-%s" $glossary_home $id | safeURL ) -}}
{{- $tooltip := $term_info.Params.short_description | markdownify -}}
{{- $tooltip := $tooltip | replaceRE "(?s)<a class='glossary-tooltip'.*?>(.*?)<span class='tooltip-text'>.*</a>" "$1" | plainify -}}
{{- $tooltip := trim $tooltip " \n" -}}
<a class='glossary-tooltip' href='{{ $external_link }}' target='_blank'>
{{- $text -}}
<span class='tooltip-text'>
{{- $tooltip | safeHTML -}}
</span>
</a>
{{- end -}}
+27
View File
@@ -0,0 +1,27 @@
{{/* This will try to find a resource in the "includes" bundle */}}
{{- $name := .Get 0 -}}
{{- if $name -}}
{{- $bundle := $.Site.GetPage "page" "includes" -}}
{{- with $bundle -}}
{{- $pattern := printf "%s*" $name -}}
{{- range $bundle.Resources -}}
{{- end -}}
{{- $resource := $bundle.Resources.GetMatch $pattern -}}
{{- with $resource -}}
{{- .Content | safeHTML -}}
{{- else -}}
{{/* It is not a resource in the includes bundle. Try to find the page relative to the current. */}}
{{- $path := path.Join $.Page.Dir $name -}}
{{- $page := $.Page.Site.GetPage "page" $path -}}
{{- with $page }}
{{ .Content }}
{{- else -}}
{{ errorf "[%s] no Resource or Page matching %q." $.Page.Lang ($pattern | safeHTML ) }}
{{- end -}}
{{- end -}}
{{- else -}}
{{ errorf "[%s] the 'inclucdes' bundle was not found." $.Page.Lang }}
{{- end -}}
{{- else -}}
{{- errorf "[%s] missing resource name in include for page %q" $.Page.Lang $.Page.Path -}}
{{- end -}}
+5
View File
@@ -0,0 +1,5 @@
{{- $text := .Get "text" -}}
{{- $url := .Get "url" -}}
{{- $target := .Get "target" | default "_blank" -}}
{{- $class := .Get "class" -}}
<a href="{{ $url }}" target="{{ $target }}"{{ with $class }}class="{{ . }}"{{ end }}>{{ $text }}</a>
+3
View File
@@ -0,0 +1,3 @@
<blockquote class="note">
<div>{{ .Inner | markdownify }}</div>
</blockquote>
+1
View File
@@ -0,0 +1 @@
{{- .Page.Param (.Get 0) -}}
+1
View File
@@ -0,0 +1 @@
<a href="{{- printf "/docs/reference/generated/kubernetes-api/%s" .Page.Site.Params.latest -}}" target="_blank">API reference docs</a>
+19
View File
@@ -0,0 +1,19 @@
{{ if .Parent }}
{{ $name := trim (.Get "name") " " }}
{{ $include := trim (.Get "include") " "}}
{{ $codelang := .Get "codelang" }}
{{ if not (.Parent.Scratch.Get "tabs") }}
{{ .Parent.Scratch.Set "tabs" slice }}
{{ end }}
{{ with .Inner }}
{{ if $codelang }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" (highlight . $codelang "") ) }}
{{ else }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }}
{{ end }}
{{ else }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "include" $include "codelang" $codelang) }}
{{ end }}
{{ else }}
{{- errorf "[%s] %q: tab shortcode missing its parent" .Page.Site.Language.Lang .Page.Path -}}
{{ end}}
+43
View File
@@ -0,0 +1,43 @@
{{ .Page.Scratch.Add "tabset-counter" 1 }}
{{ $tab_set_id := .Get "name" | default (printf "tabset-%s-%d" (.Page.RelPermalink) (.Page.Scratch.Get "tabset-counter") ) | anchorize }}
{{ $tabs := .Scratch.Get "tabs" }}
{{ if .Inner }}{{/* We don't use the inner content, but Hugo will complain if we don't reference it. */}}{{ end }}
<div id="{{ $tab_set_id }}">
<ul>
{{ range $i, $e := $tabs }}
{{ $id := printf "%s-%d" $tab_set_id $i }}
<li><a href="#{{ $id }}">{{ trim .name " " }}</a></li>
{{ end }}
</ul>
{{ range $i, $e := $tabs }}
{{ $id := printf "%s-%d" $tab_set_id $i }}
<div id="{{ $id }}">
{{ with .content }}
{{ . }}
{{ else }}
{{ if eq $.Page.BundleType "leaf" }}
{{/* find the file somewhere inside the bundle. Note the use of double asterisk */}}
{{ with $.Page.Resources.GetMatch (printf "**%s*" .include) }}
{{ if ne .ResourceType "page" }}
{{/* Assume it is a file that needs code highlighting. */}}
{{ $codelang := $e.codelang | default ( path.Ext .Name | strings.TrimPrefix ".") }}
{{ highlight .Content $codelang "" }}
{{ else}}
{{ .Content }}
{{ end }}
{{ end }}
{{ else}}
{{ $path := path.Join $.Page.Dir .include }}
{{ $page := $.Page.Site.GetPage "page" $path }}
{{ with $page }}
{{ .Content }}
{{ else }}
{{ errorf "[%s] tabs include not found for path %q" $.Page.Site.Language.Lang $path}}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
{{ $elem := $tab_set_id | safeJS }}
<script>$(function(){$("#{{ $elem }}").tabs();});</script>
+1
View File
@@ -0,0 +1 @@
{{ .Page.TableOfContents }}
+6
View File
@@ -0,0 +1,6 @@
{{ $minVersion := .Page.Param "min-kubernetes-server-version" }}
{{ if eq $minVersion (.Page.Param "version") }}
Your Kubernetes server must be version {{ $minVersion }}.
{{ else if $minVersion}}
Your Kubernetes server must be version {{ $minVersion }} or later.
{{ end }} To check the version, enter <code>kubectl version</code>.
+9
View File
@@ -0,0 +1,9 @@
{{ $versions := .Page.Param "versions" }}
{{ $thisVersion := .Page.Param "version" }}
<ul>
{{ range $versions }}
{{ if ne .version $thisVersion }}
<li><a href="{{ .url }}">{{ .version }}</a></li>
{{ end }}
{{ end }}
</ul>
+3
View File
@@ -0,0 +1,3 @@
<blockquote class="warning">
<div>{{ .Inner | markdownify }}</div>
</blockquote>