Update to Hugo 0.53 and remove all .Site references (#12079)
* Remove all .Site variable references * Update Hugo version in Travis CI config and Makefilepull/12516/head
parent
2ccb5d61c6
commit
c6dd35ba51
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
|||
DOCKER = docker
|
||||
HUGO_VERSION = 0.52
|
||||
HUGO_VERSION = 0.53
|
||||
DOCKER_IMAGE = kubernetes-hugo
|
||||
DOCKER_RUN = $(DOCKER) run --rm --interactive --tty --volume $(CURDIR):/src
|
||||
NODE_BIN = node_modules/.bin
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
</div>
|
||||
<div class="col-xs-12 col-md-3 text">
|
||||
<div class="widget-content">
|
||||
{{ with .Site.Home.OutputFormats.Get "rss" -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}" title="{{ $.Site.Title }}">
|
||||
{{ 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>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ define "main" }}
|
||||
{{ $pages := ($.Paginator 1).Pages }}
|
||||
{{ with $.Site.Params.language_alternatives }}
|
||||
{{ with site.Params.language_alternatives }}
|
||||
{{ range . }}
|
||||
{{ with (where $.Translations ".Lang" . ) }}
|
||||
{{ $p := index . 0 }}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<h4 class="date-header">{{ .Date.Format .Site.Params.time_format_blog }}</h4>
|
||||
<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 }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ define "main" }}
|
||||
{{ $pages := .Pages }}
|
||||
{{ with $.Site.Params.language_alternatives }}
|
||||
{{ with site.Params.language_alternatives }}
|
||||
{{ range . }}
|
||||
{{ with (where $.Translations ".Lang" . ) }}
|
||||
{{ $p := index . 0 }}
|
||||
|
@ -65,4 +65,4 @@
|
|||
<p class="quote">"{{ .page.Params.quote | html }}"</p>
|
||||
<a href="{{ .page.RelPermalink }}"{{ if $isForeignLanguage }} target="_blank"{{ end }}>{{ T "main_read_about"}} {{ .page.LinkTitle }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
<div class="launch-card">
|
||||
<h4>Try Kubernetes</h4>
|
||||
|
||||
|
||||
<p>Follow tutorials to learn how to deploy applications in Kubernetes.</p>
|
||||
<br>
|
||||
<ul>
|
||||
|
@ -53,7 +53,7 @@
|
|||
|
||||
<div class="launch-card">
|
||||
<h4>Set up a cluster</h4>
|
||||
|
||||
|
||||
<p>Get Kubernetes running based on your resources and needs.</p>
|
||||
<br>
|
||||
<ul>
|
||||
|
@ -70,7 +70,7 @@
|
|||
|
||||
<div class="launch-card">
|
||||
<h4>Learn how to use Kubernetes</h4>
|
||||
|
||||
|
||||
<p>Look up common tasks and how to perform them using a short sequence of steps.</p>
|
||||
<br>
|
||||
<ul>
|
||||
|
@ -86,7 +86,7 @@
|
|||
|
||||
<div class="launch-card">
|
||||
<h4>Look up reference information</h4>
|
||||
|
||||
|
||||
<p>Browse terminology, command line syntax, API resource types, and setup tool documentation.</p>
|
||||
<br>
|
||||
<ul>
|
||||
|
@ -102,7 +102,7 @@
|
|||
|
||||
<div class="launch-card">
|
||||
<h4>Contribute to the docs</h4>
|
||||
|
||||
|
||||
<p>Anyone can contribute, whether you’re new to the project or you’ve been around a long time.</p>
|
||||
<br>
|
||||
<ul>
|
||||
|
@ -118,7 +118,7 @@
|
|||
|
||||
<div class="launch-card">
|
||||
<h4>Download Kubernetes</h4>
|
||||
|
||||
|
||||
<p>If you are installing Kubernetes or upgrading to the newest version, refer to the current release notes.</p>
|
||||
<br>
|
||||
<ul>
|
||||
|
@ -130,7 +130,7 @@
|
|||
|
||||
<div class="launch-card">
|
||||
<h4>About the documentation</h4>
|
||||
|
||||
|
||||
<p>This website contains documentation for the current and previous 4 versions of Kubernetes.</p>
|
||||
<br>
|
||||
<ul>
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
<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") }}
|
||||
{{ 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" }}
|
||||
{{ $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 }}">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- if eq (getenv "HUGO_ENV") "production" }}
|
||||
{{- $cssFilesFromConfig := .Site.Params.pushAssets.css -}}
|
||||
{{- $jsFilesFromConfig := .Site.Params.pushAssets.js -}}
|
||||
{{- $pages := .Site.RegularPages -}}
|
||||
{{- $cssFilesFromConfig := site.Params.pushAssets.css -}}
|
||||
{{- $jsFilesFromConfig := site.Params.pushAssets.js -}}
|
||||
{{- $pages := site.RegularPages -}}
|
||||
Link: </images/favicon.png>; rel=preload; as=image
|
||||
{{- range $cssFilesFromConfig -}}
|
||||
{{- $cssUrl := printf "/css/%s.css" . }}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
|
||||
{{ define "hero-more" }}
|
||||
{{ with .Site.GetPage "section" "docs/tutorials/kubernetes-basics" }}
|
||||
{{ with site.GetPage "section" "docs/tutorials/kubernetes-basics" }}
|
||||
<a href="{{ .RelPermalink }}" id="quickstartButton" class="button">{{ .LinkTitle }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ .Site.Title }} – {{ .Title }}</title>
|
||||
<title>{{ site.Title }} – {{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>The Kubernetes project blog</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 }}
|
||||
<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>
|
||||
|
@ -17,12 +17,12 @@
|
|||
{{ 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")) }}
|
||||
{{ 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}}
|
||||
{{ with site.Author.email }}<author>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>
|
||||
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{ $pages := .CurrentSection.Pages }}
|
||||
{{ with $.Site.Params.language_alternatives }}
|
||||
{{ with site.Params.language_alternatives }}
|
||||
{{ range . }}
|
||||
{{ with (where $.CurrentSection.Translations ".Lang" . ) }}
|
||||
{{ $p := index . 0 }}
|
||||
|
@ -28,4 +28,4 @@
|
|||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<h3>
|
||||
Kubernetes {{ .Param "version" }}
|
||||
{{ T "deprecation_warning" }}
|
||||
<a href="{{ .Site.Params.currentUrl }}">{{ T "latest_version" }}</a>
|
||||
<a href="{{ site.Params.currentUrl }}">{{ T "latest_version" }}</a>
|
||||
</h3>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
{{ define "docs-browse-section" }}
|
||||
{{ $pages := .page.Pages }}
|
||||
{{ $sections := .page.Sections }}
|
||||
{{ with $.ctx.Site.Params.language_alternatives }}
|
||||
{{ with site.Params.language_alternatives }}
|
||||
{{ range . }}
|
||||
{{ with (where $.page.Translations ".Lang" . ) }}
|
||||
{{ $p := index . 0 }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ $glossaryBundle := .Site.GetPage "page" "docs/reference/glossary" }}
|
||||
{{ $glossaryBundle := site.GetPage "page" "docs/reference/glossary" }}
|
||||
{{- if $glossaryBundle -}}
|
||||
{{ $pages := $glossaryBundle.Resources.ByType "page" }}
|
||||
{{- range $.Site.Params.language_alternatives -}}
|
||||
{{- range site.Params.language_alternatives -}}
|
||||
{{- with (where $glossaryBundle.Translations ".Lang" . ) -}}
|
||||
{{ $p := (index . 0) }}
|
||||
{{ $pages = $pages | lang.Merge ($p.Resources.ByType "page") }}
|
||||
|
@ -9,5 +9,5 @@
|
|||
{{ end }}
|
||||
{{- $.Scratch.Set "glossary_items" $pages -}}
|
||||
{{- else -}}
|
||||
{{- errorf "[%s] Glossary Bundle not found for language. Create at least an index.md file inside docs/reference/glossary" .Page.Site.Language.Lang -}}
|
||||
{{- errorf "[%s] Glossary Bundle not found for language. Create at least an index.md file inside docs/reference/glossary" site.Language.Lang -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{{ $p := . }}
|
||||
{{ .Scratch.Set "section" .CurrentSection }}
|
||||
{{ .Scratch.Set "sectionFound" false }}
|
||||
{{ $docs := .Site.GetPage "section" "docs" }}
|
||||
{{ $docs := site.GetPage "section" "docs" }}
|
||||
{{ if ne .CurrentSection $docs }}
|
||||
{{ range $docs.Sections }}
|
||||
{{ if not ($.Scratch.Get "sectionFound") }}
|
||||
|
@ -21,4 +21,4 @@
|
|||
{{ partialCached "tree.html" $section $section.RelPermalink }}
|
||||
</div> <!-- /pi-accordion -->
|
||||
<button class="push-menu-close-button" onclick="kub.toggleToc()"></button>
|
||||
</div> <!-- /docsToc -->
|
||||
</div> <!-- /docsToc -->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ $p := . }}
|
||||
{{ $home := .Site.Home }}
|
||||
{{ $docs := .Site.GetPage "section" "docs" }}
|
||||
{{ $home := site.Home }}
|
||||
{{ $docs := site.GetPage "section" "docs" }}
|
||||
{{ $menuSections := (where $docs.Sections ".Params.main_menu" true) }}
|
||||
{{ range $menuSections }}
|
||||
{{ if $p.IsDescendant . }}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<footer>
|
||||
<main class="light-text">
|
||||
<nav>
|
||||
{{ with $.Site.GetPage "page" "docs/tutorials/stateless-application/hello-minikube" }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
|
||||
{{ 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 }}
|
||||
{{ with site.GetPage "section" . }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
|
||||
{{ end }}
|
||||
</nav>
|
||||
<div class="social">
|
||||
|
@ -19,7 +19,7 @@
|
|||
<a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%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 }}
|
||||
{{ 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>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if not .Params.noedit }}
|
||||
<a href="https://github.com/kubernetes/website/edit/master/content/{{ .Site.Language.Lang }}/{{ .File.Path }}" class="button issue">{{ T "main_edit_this_page" }}</a>
|
||||
<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 }}
|
||||
</div>
|
||||
{{ if and (not .Params.showcommit) $.GitInfo }}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
gtag('config', 'UA-36037335-10');
|
||||
</script>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ if .Title }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
|
||||
<title>{{ if .Title }}{{ .Title }} - {{ end }}{{ site.Title }}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="shortcut icon" type="image/png" href="{{ "images/favicon.png" | relURL }}">
|
||||
{{ partial "css.html" . }}
|
||||
|
@ -23,7 +23,7 @@
|
|||
<meta property="og:title" content="{{ if .Params.title }}{{ .Title }}{{ else }}{{ .Summary | truncate 10 }}{{ end }}">
|
||||
<meta name="twitter:title" content="{{ if .Params.title }}{{ .Title }}{{ else }}{{ .Summary | truncate 10 }}{{ end }}">
|
||||
<!-- Alt text for the site image -->
|
||||
<meta name="twitter:image:alt" content="{{ .Site.Title }}">
|
||||
<meta name="twitter:image:alt" content="{{ site.Title }}">
|
||||
{{ if $isBlogPost }}
|
||||
{{ with findRE "<img.*?>" .Content 1 }}
|
||||
<meta property="og:image" content="{{ index . 0 | replaceRE ".*src=\"(.+?)\".*" "$1" }}">
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<div id="cellophane" onclick="kub.toggleMenu()"></div>
|
||||
|
||||
<header>
|
||||
<a href="{{ .Site.Home.RelPermalink }}" class="logo"></a>
|
||||
<a href="{{ site.Home.RelPermalink }}" class="logo"></a>
|
||||
|
||||
<div class="nav-buttons" data-auto-burger="primary">
|
||||
<ul class="global-nav">
|
||||
{{ $sections := slice "docs" "blog" "partners" "community" "case-studies" }}
|
||||
{{ range $sections }}
|
||||
{{ with $.Site.GetPage "section" . }}<li><a href="{{ .RelPermalink }}"{{ if eq .Section $.Section }} class="active"{{ end}}>{{ .LinkTitle }}</a></li>{{ end }}
|
||||
{{ with site.GetPage "section" . }}<li><a href="{{ .RelPermalink }}"{{ if eq .Section $.Section }} class="active"{{ end}}>{{ .LinkTitle }}</a></li>{{ end }}
|
||||
{{ end }}
|
||||
{{/* Link directly to documentation etc., if possible. */}}
|
||||
{{ $langPage := cond (gt (len .Translations) 0) . .Site.Home }}
|
||||
{{ $langPage := cond (gt (len .Translations) 0) . site.Home }}
|
||||
<li>
|
||||
<a href="#">
|
||||
{{ $langPage.Language.LanguageName }} <span class="ui-icon ui-icon-carat-1-s"></span>
|
||||
|
@ -24,16 +24,16 @@
|
|||
|
||||
<li>
|
||||
<a href="#">
|
||||
{{ .Site.Params.version }} <span class="ui-icon ui-icon-carat-1-s"></span>
|
||||
{{ site.Params.version }} <span class="ui-icon ui-icon-carat-1-s"></span>
|
||||
</a>
|
||||
<ul>
|
||||
{{ range .Site.Params.versions }}
|
||||
{{ range site.Params.versions }}
|
||||
<li><a href="{{ .url }}">{{ .version }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{{ with .Site.GetPage "section" "docs/tutorials/kubernetes-basics" }}
|
||||
{{ with site.GetPage "section" "docs/tutorials/kubernetes-basics" }}
|
||||
<a href="{{ .RelPermalink }}" class="button" id="tryKubernetes" data-auto-burger-exclude>{{ .LinkTitle }}</a>
|
||||
{{ end }}
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
<nav id="mainNav">
|
||||
<main data-auto-burger="primary">
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ range site.Menus.main }}
|
||||
<div class="nav-box">
|
||||
<h3><a href="{{ .URL }}">{{ .Title }}</a></h3>
|
||||
{{ .Post }}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<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 }}
|
||||
{{ $templates := site.GetPage "page" $templates_path }}
|
||||
{{ with $templates.Resources }}
|
||||
{{ $template_path := printf "**feature-state-%s*" $state }}
|
||||
{{ $content_template := .GetMatch $template_path }}
|
||||
|
@ -13,9 +13,9 @@
|
|||
{{ $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 }}
|
||||
{{ errorf "[%s] template not found in %s" site.Language.Lang $template_path }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "[%s] templates not found in docs/templates" .page.Site.Language.Lang }}
|
||||
{{ errorf "[%s] templates not found in docs/templates" site.Language.Lang }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{ template "section-tree-nav" (dict "ctx" . "section" .) }}
|
||||
{{ define "section-tree-nav" }}
|
||||
{{ $pages := (union .section.Pages .section.Sections) }}
|
||||
{{ with $.ctx.Site.Params.language_alternatives }}
|
||||
{{ with site.Params.language_alternatives }}
|
||||
{{ range . }}
|
||||
{{ with (where $.section.Translations ".Lang" . ) }}
|
||||
{{ $p := index . 0 }}
|
||||
|
@ -34,4 +34,4 @@
|
|||
{{ 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 }}"></a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{/* This file contains some common template definitions used in the blocks shortcodes.
|
||||
The reasoning behind the long and hard-to-remember template names is that these templates are global. */}}
|
||||
{{ define "shortcodes-blocks_getimage" }}
|
||||
{{- $cr := .ctx.Site.GetPage "/_common-resources" -}}
|
||||
{{- $cr := site.GetPage "/_common-resources" -}}
|
||||
{{- with $cr -}}
|
||||
{{- $image := $cr.Resources.GetMatch (printf "images/**%s*" $.name ) -}}
|
||||
{{- with $image -}}
|
||||
|
@ -12,4 +12,4 @@ The reasoning behind the long and hard-to-remember template names is that these
|
|||
{{- else -}}
|
||||
{{ errorf "[%s] No resource bundle found. Create an empty headless bundle; create content/%s/_common-resources/index.md with \"headless: true\" in front matter. See https://gohugo.io/content-management/page-bundles/#headless-bundle" $.ctx.Page.Lang $.ctx.Page.Lang }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ $caseStudiesSection := .Site.GetPage "case-studies" }}
|
||||
{{ $caseStudiesSection := site.GetPage "case-studies" }}
|
||||
{{ if not $caseStudiesSection }}
|
||||
{{ errorf "[%s] No case-studies section found. Create content/%s/case-studies/_index.md" $.Page.Lang $.Page.Lang }}
|
||||
{{ else }}
|
||||
|
@ -19,4 +19,4 @@
|
|||
<h5 style="text-align: center"><a href="/case-studies/" style="color: #3371E3; font-weight: 400">{{ $caseStudiesSection.LinkTitle }}</a></h5>
|
||||
</main>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -17,7 +17,7 @@ Note that markdown can be used in the description.
|
|||
<section id="features">
|
||||
<main>
|
||||
<h3 class="center">{{ T "main_kubernetes_features" }}</h3>
|
||||
{{ $pages := where .Site.Pages ".Params.feature" "!=" nil }}
|
||||
{{ $pages := where site.Pages ".Params.feature" "!=" nil }}
|
||||
{{range $i, $p := $pages }}
|
||||
{{ if and (gt $i 0) (modBool $i 2) }}</div>{{ end }}
|
||||
{{ if modBool $i 2 }}
|
||||
|
@ -33,4 +33,4 @@ Note that markdown can be used in the description.
|
|||
|
||||
{{ end }}
|
||||
</main>
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{{ $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 }}
|
||||
{{ $ghlink := printf "https://%s/blob/master/content/%s/%s" 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 }}
|
||||
|
@ -15,7 +15,7 @@
|
|||
{{ 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 }}
|
||||
{{ errorf "[%s] %q not found in %q" site.Language.Lang $fileDir.File $bundlePath }}
|
||||
{{ end }}
|
||||
{{ with $.Scratch.Get "content" }}
|
||||
<table class="includecode" id="{{ $file | anchorize }}">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{{ $fileDir := path.Split $file }}
|
||||
{{ $bundlePath := path.Join .Page.Dir $fileDir.Dir }}
|
||||
{{ $filename := printf "/content/%s/examples/%s" .Page.Lang $file | safeURL }}
|
||||
{{ $ghlink := printf "https://%s/master%s" .Page.Site.Params.githubWebsiteRaw $filename | safeURL }}
|
||||
{{ $ghlink := printf "https://%s/master%s" site.Params.githubWebsiteRaw $filename | safeURL }}
|
||||
{{/* First assume this is a bundle and the file is inside it. */}}
|
||||
{{ $resource := $p.Resources.GetMatch (printf "%s*" $file ) }}
|
||||
{{ with $resource }}
|
||||
|
@ -15,7 +15,7 @@
|
|||
{{ 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 }}
|
||||
{{ errorf "[%s] %q not found in %q" site.Language.Lang $fileDir.File $bundlePath }}
|
||||
{{ end }}
|
||||
{{ with $.Scratch.Get "content" }}
|
||||
<table class="includecode" id="{{ $file | anchorize }}">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<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="{{ .Site.Params.currentUrl }}">latest</a> version.
|
||||
For up-to-date documentation, see the <a href="{{ site.Params.currentUrl }}">latest</a> version.
|
||||
</h3>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
{{- $id := .Get "term_id" -}}
|
||||
{{- $length := .Get "length" -}}
|
||||
{{- $prepend := .Get "prepend" }}
|
||||
{{- $glossaryBundle := .Site.GetPage "page" "docs/reference/glossary" -}}
|
||||
{{- $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 -}}
|
||||
{{- errorf "[%s] %q: %q is not a valid glossary term_id, see ./docs/reference/glossary/* for a full list" site.Language.Lang .Page.Path $id -}}
|
||||
{{- end -}}
|
||||
{{- with $term_info -}}
|
||||
{{- if (strings.Contains "short" $length) -}}
|
||||
|
@ -26,4 +26,4 @@
|
|||
{{- replace . $firstPara $prepended | safeHTML -}}{{ else }}{{- . -}}{{ end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
{{- partial "docs/glossary-terms.html" $.Page -}}
|
||||
{{- $glossary_items := $.Page.Scratch.Get "glossary_items" -}}
|
||||
{{- if not $glossary_items -}}
|
||||
{{- errorf "[%s] No glossary items found" .Page.Site.Language.Lang -}}
|
||||
{{- errorf "[%s] No glossary items found" site.Language.Lang -}}
|
||||
{{- else -}}
|
||||
{{- $term_info := $glossary_items.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 -}}
|
||||
{{- errorf "[%s] %q: %q is not a valid glossary term_id, see ./docs/reference/glossary/* for a full list" site.Language.Lang .Page.Path $id -}}
|
||||
{{- end }}
|
||||
{{- with $term_info -}}
|
||||
{{- $text := $text | default $term_info.Title -}}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{/* This will try to find a resource in the "includes" bundle */}}
|
||||
{{- $name := .Get 0 -}}
|
||||
{{- if $name -}}
|
||||
{{- $bundle := $.Site.GetPage "page" "includes" -}}
|
||||
{{- $bundle := site.GetPage "page" "includes" -}}
|
||||
{{- with $bundle -}}
|
||||
{{- $pattern := printf "%s*" $name -}}
|
||||
{{- range $bundle.Resources -}}
|
||||
|
@ -12,7 +12,7 @@
|
|||
{{- 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 -}}
|
||||
{{- $page := site.GetPage "page" $path -}}
|
||||
{{- with $page }}
|
||||
{{ .Content }}
|
||||
{{- else -}}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{{ .Site.Params.latest }}
|
||||
{{ site.Params.latest }}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<a href="{{- printf "/docs/reference/generated/kubernetes-api/%s" .Page.Site.Params.latest -}}" target="_blank">API reference docs</a>
|
||||
<a href="{{- printf "/docs/reference/generated/kubernetes-api/%s" site.Params.latest -}}" target="_blank">API reference docs</a>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{{- $latestVersion := .Site.Params.latest }}
|
||||
{{- $latestVersion := site.Params.latest }}
|
||||
{{- $latestReleaseBranch := printf "release-%s" (replace $latestVersion "v" "") }}
|
||||
{{- $latestReleaseBranch }}
|
||||
{{- $latestReleaseBranch }}
|
||||
|
|
|
@ -15,5 +15,5 @@
|
|||
{{ $.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}}
|
||||
{{- errorf "[%s] %q: tab shortcode missing its parent" site.Language.Lang .Page.Path -}}
|
||||
{{ end}}
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
{{ end }}
|
||||
{{ else}}
|
||||
{{ $path := path.Join $.Page.Dir .include }}
|
||||
{{ $page := $.Page.Site.GetPage "page" $path }}
|
||||
{{ $page := site.GetPage "page" $path }}
|
||||
{{ with $page }}
|
||||
{{ .Content }}
|
||||
{{ else }}
|
||||
{{ errorf "[%s] tabs include not found for path %q" $.Page.Site.Language.Lang $path}}
|
||||
{{ errorf "[%s] tabs include not found for path %q" site.Language.Lang $path}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -7,7 +7,7 @@ functions = "functions"
|
|||
command = "make non-production-build"
|
||||
|
||||
[build.environment]
|
||||
HUGO_VERSION = "0.52"
|
||||
HUGO_VERSION = "0.53"
|
||||
|
||||
[context.production.environment]
|
||||
HUGO_BASEURL = "https://kubernetes.io/"
|
||||
|
|
Loading…
Reference in New Issue