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,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 -}}
+2 -2
View File
@@ -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>
+2 -2
View File
@@ -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 }}">
+2 -2
View File
@@ -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 }}">
+1 -1
View File
@@ -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>
+3 -3
View File
@@ -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 -}}
+2 -2
View File
@@ -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 -}}
+2 -2
View File
@@ -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
View File
@@ -1 +1 @@
{{ .Site.Params.latest }}
{{ site.Params.latest }}
+1 -1
View File
@@ -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>
+2 -2
View File
@@ -1,3 +1,3 @@
{{- $latestVersion := .Site.Params.latest }}
{{- $latestVersion := site.Params.latest }}
{{- $latestReleaseBranch := printf "release-%s" (replace $latestVersion "v" "") }}
{{- $latestReleaseBranch }}
{{- $latestReleaseBranch }}
+2 -2
View File
@@ -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}}
+2 -2
View File
@@ -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 }}