From b7595a0ed24806204e8eeb048ec9b3d76fc6ad66 Mon Sep 17 00:00:00 2001 From: zacharysarah Date: Tue, 27 Aug 2019 14:58:59 -0700 Subject: [PATCH 1/2] 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 --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index b0fee252cae5a..a312d030e1a54 100644 --- a/netlify.toml +++ b/netlify.toml @@ -7,7 +7,7 @@ functions = "functions" command = "make non-production-build" [build.environment] -HUGO_VERSION = "0.53" +HUGO_VERSION = "0.57.2" [context.production.environment] HUGO_BASEURL = "https://kubernetes.io/" From bba51a0d5559542688587a6044adb37bd897f1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 9 Apr 2019 03:19:05 +0200 Subject: [PATCH 2/2] Make it compatible with Hugo 0.55 (#13680) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- layouts/case-studies/list.html | 2 +- layouts/docs/list.html | 8 +++++++- layouts/partials/docs/top-menu.html | 2 +- layouts/partials/git-info.html | 2 +- layouts/partials/templates/blocks.html | 6 +++--- layouts/shortcodes/capture.html | 1 + layouts/shortcodes/code.html | 4 ++-- layouts/shortcodes/codenew.html | 2 +- layouts/shortcodes/include.html | 2 +- layouts/shortcodes/tabs.html | 2 +- 10 files changed, 19 insertions(+), 12 deletions(-) diff --git a/layouts/case-studies/list.html b/layouts/case-studies/list.html index 7998cf5c0b654..6d554f8a096a2 100644 --- a/layouts/case-studies/list.html +++ b/layouts/case-studies/list.html @@ -48,7 +48,7 @@

{{ .Title }}

{{ $logo := .Resources.GetMatch "**logo*.png" }} {{ $p := . }} {{ with $logo }}{{ $p.LinkTitle }}{{ else }} - {{ errorf "Case Studies: Missing logo for %s. Put a PNG with the word 'logo' in the filename into %q" $p.LinkTitle $p.Dir }} + {{ errorf "Case Studies: Missing logo for %s. Put a PNG with the word 'logo' in the filename into %q" $p.LinkTitle $p.File.Dir }} {{ end }} {{ end }} Tell your story diff --git a/layouts/docs/list.html b/layouts/docs/list.html index 5d1101e3dca4c..cbeaa2509441c 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -1,5 +1,11 @@ {{ define "content" }} - {{ with .Content }} + {{ $hasContent := false }} + {{ with .File }} + {{ if ne .Filename "" }} + {{ $hasContent = (ge (len $.RawContent) 100) }} + {{ end }} + {{ end }} + {{ if $hasContent }} {{ partial "docs/content-page" (dict "ctx" $ "page" $ ) }} {{ else }} {{ if ge (len .Pages) 1 }} diff --git a/layouts/partials/docs/top-menu.html b/layouts/partials/docs/top-menu.html index 452cf8bec098d..25093e9b1ae93 100644 --- a/layouts/partials/docs/top-menu.html +++ b/layouts/partials/docs/top-menu.html @@ -4,7 +4,7 @@ {{ $menuSections := (where $docs.Sections ".Params.main_menu" true) }} {{ range $menuSections }} {{ if $p.IsDescendant . }} -

{{ if not (strings.Contains .Dir "home")}}{{ .Params.bigheader | default .Title }}{{ end }}

+

{{ if not (strings.Contains .Path "home")}}{{ .Params.bigheader | default .Title }}{{ end }}

{{ .Params.abstract }}
{{ end }} {{ end }} diff --git a/layouts/partials/git-info.html b/layouts/partials/git-info.html index 40dcab847ce13..c5268829f009c 100644 --- a/layouts/partials/git-info.html +++ b/layouts/partials/git-info.html @@ -19,7 +19,7 @@ {{ end }} {{ end }} {{ if not .Params.noedit }} - {{ T "main_edit_this_page" }} + {{ if .File }}{{ T "main_edit_this_page" }}{{ end }} {{ end }} {{ if and (not .Params.showcommit) $.GitInfo }} diff --git a/layouts/partials/templates/blocks.html b/layouts/partials/templates/blocks.html index 765b884ac70c2..2056538510d16 100644 --- a/layouts/partials/templates/blocks.html +++ b/layouts/partials/templates/blocks.html @@ -1,10 +1,10 @@ {{ .ctx.Scratch.Set "sections" slice }}