From d289d5bddace952120e4ecd8cd67d03c5eb1b489 Mon Sep 17 00:00:00 2001 From: Sarah Maddox Date: Sun, 18 Nov 2018 06:24:04 +1100 Subject: [PATCH] Ad nil checks for menus and footer links This commit also bumps `netlify.toml` to a newer Hugo version, as variable overwrites needs Go 1.11. It can be made to work with older Hugo's, but ... See https://github.com/gohugoio/hugo/issues/5461 --- netlify.toml | 4 ++-- themes/docsy/layouts/partials/footer.html | 8 ++++++-- themes/docsy/layouts/partials/navbar.html | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/netlify.toml b/netlify.toml index 64da137689..77b78148ef 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ command = "hugo" [context.deploy-preview.environment] - HUGO_VERSION = "0.40" + HUGO_VERSION = "0.51" [context.production.environment] - HUGO_VERSION = "0.40" + HUGO_VERSION = "0.51" diff --git a/themes/docsy/layouts/partials/footer.html b/themes/docsy/layouts/partials/footer.html index 76dc9c0f0e..d9cae5e7e7 100644 --- a/themes/docsy/layouts/partials/footer.html +++ b/themes/docsy/layouts/partials/footer.html @@ -3,14 +3,18 @@
- {{ with index $links "user"}} + {{ with $links }} + {{ with index . "user"}} {{ template "footer-links-block" . }} {{ end }} + {{ end }}
- {{ with index $links "developer"}} + {{ with $links }} + {{ with index . "developer"}} {{ template "footer-links-block" . }} {{ end }} + {{ end }}
{{ with .Site.Params.copyright }}© {{ now.Year}} {{ .}} {{ T "footer_all_rights_reserved" }}{{ end }} diff --git a/themes/docsy/layouts/partials/navbar.html b/themes/docsy/layouts/partials/navbar.html index aed6425c89..68a5b07948 100644 --- a/themes/docsy/layouts/partials/navbar.html +++ b/themes/docsy/layouts/partials/navbar.html @@ -9,7 +9,9 @@ {{ range .Site.Menus.main }} {{ end }}