Upgrade 1.13 to Hugo 0.57.2 (#16104)

* lower case url

Invoke site param as a string

Invoke site param as text

Remove leading dot

Invoke as a page variable

Tweak the page param invocation

lower case

Update Hugo version to 0.57.2

* Make it compatible with Hugo 0.55 (#13680)

This commit adds two backwards compatible changes to prepare for the next Hugo version, most notable:

* All the `File` methods on `Page` has been deprecated and will give a warning in the next Hugo version. Adjust this by changing `.Dir` to ´.File.Dir` and similar.
* Version the capture shortcode to use the old behaviour for markdown rendering of shortcode inner content.
This commit is contained in:
Zach Corleissen
2019-10-02 07:07:09 -07:00
committed by Kubernetes Prow Robot
parent bda7f1f517
commit 921adb4ff1
11 changed files with 20 additions and 13 deletions
+1
View File
@@ -1,3 +1,4 @@
{{ $_hugo_config := `{ "version": 1 }`}}
{{- $id := .Get 0 -}}
{{- if not $id -}}
{{- errorf "missing id in capture" -}}
+2 -2
View File
@@ -2,8 +2,8 @@
{{ $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 }}
{{ $bundlePath := path.Join .Page.File.Dir $fileDir.Dir }}
{{ $filename := path.Join $p.File.Dir $file }}
{{ $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 ) }}
+1 -1
View File
@@ -2,7 +2,7 @@
{{ $file := .Get "file" }}
{{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
{{ $fileDir := path.Split $file }}
{{ $bundlePath := path.Join .Page.Dir $fileDir.Dir }}
{{ $bundlePath := path.Join .Page.File.Dir $fileDir.Dir }}
{{ $filename := printf "/content/%s/examples/%s" .Page.Lang $file | safeURL }}
{{ $ghlink := printf "https://%s/master%s" site.Params.githubwebsiteraw $filename | safeURL }}
{{/* First assume this is a bundle and the file is inside it. */}}
+1 -1
View File
@@ -11,7 +11,7 @@
{{- .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 -}}
{{- $path := path.Join $.Page.File.Dir $name -}}
{{- $page := site.GetPage "page" $path -}}
{{- with $page }}
{{ .Content }}
+1 -1
View File
@@ -27,7 +27,7 @@
{{ end }}
{{ end }}
{{ else}}
{{ $path := path.Join $.Page.Dir .include }}
{{ $path := path.Join $.Page.File.Dir .include }}
{{ $page := site.GetPage "page" $path }}
{{ with $page }}
{{ .Content }}