Update to Hugo 0.53 and remove all .Site references (#12079)

* Remove all .Site variable references

* Update Hugo version in Travis CI config and Makefile
This commit is contained in:
Luc Perkins
2019-02-05 08:33:23 -08:00
committed by Kubernetes Prow Robot
parent 2ccb5d61c6
commit c6dd35ba51
37 changed files with 84 additions and 84 deletions
+2 -2
View File
@@ -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>
+1 -1
View File
@@ -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>
+1 -1
View File
@@ -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 }}
+3 -3
View File
@@ -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 -}}
+2 -2
View File
@@ -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 -->
+2 -2
View File
@@ -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 . }}
+3 -3
View File
@@ -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>
+1 -1
View File
@@ -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 }}
+2 -2
View File
@@ -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" }}">
+7 -7
View File
@@ -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 -2
View File
@@ -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 }}