From 8262ab6f2d7b01e134fd3a4d945fbb77e54128bc Mon Sep 17 00:00:00 2001 From: Ghyslain Leclerc Date: Wed, 28 Dec 2016 21:13:54 -0500 Subject: [PATCH] Made the theme compatible with Hugo 0.18. At least in Hugo 0.18 (I don't know for prior versions), the variables in the templates are all set to lowercase even if they are not lowercase in the config file. For instance, for a configuration as follows: [Author] Handle = "bla" the variable must be used as .Site.Author.handle and not .Site.Author.Handle. --- layouts/partials/custom_image_handler.html | 2 +- layouts/partials/page_footer.html | 10 +++++----- layouts/partials/page_header.html | 6 +++--- layouts/partials/site_header.html | 12 ++++++------ layouts/rss.xml | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/layouts/partials/custom_image_handler.html b/layouts/partials/custom_image_handler.html index 1271545..ec1ad7f 100644 --- a/layouts/partials/custom_image_handler.html +++ b/layouts/partials/custom_image_handler.html @@ -3,7 +3,7 @@ // @summary: jquery implementation $(function() { // @summary: Use the author's flickr ID to load images from the public flickr feed - $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id={{ .Site.Author.FlickrID }}&format=json&jsoncallback=?", function(data) { + $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id={{ .Site.Author.flickrid }}&format=json&jsoncallback=?", function(data) { iweblog.application.displayImages(data, 8); }); }); diff --git a/layouts/partials/page_footer.html b/layouts/partials/page_footer.html index dc661cf..b76e34f 100644 --- a/layouts/partials/page_footer.html +++ b/layouts/partials/page_footer.html @@ -1,22 +1,22 @@ diff --git a/layouts/partials/page_header.html b/layouts/partials/page_header.html index d566947..a8038a5 100644 --- a/layouts/partials/page_header.html +++ b/layouts/partials/page_header.html @@ -1,8 +1,8 @@
diff --git a/layouts/partials/site_header.html b/layouts/partials/site_header.html index 4bc4168..02198fe 100644 --- a/layouts/partials/site_header.html +++ b/layouts/partials/site_header.html @@ -4,19 +4,19 @@ - - + + {{ .Hugo.Generator }} {{ $.Scratch.Add "title" .Site.Title }} - {{ with .Title }}{{ if ne . ($.Scratch.Get "title") }}{{ . }} · {{ end }}{{ end }}@{{ .Site.Author.Handle }}’s {{ .Site.Title }} + {{ with .Title }}{{ if ne . ($.Scratch.Get "title") }}{{ . }} · {{ end }}{{ end }}@{{ .Site.Author.handle }}’s {{ .Site.Title }} {{ partial "custom_stylesheets.html" . }} - {{ if .Site.Params.RSSEnabled }} - - {{ end }} + {{ if .Site.Params.rssenabled }} + + {{ end }} diff --git a/layouts/rss.xml b/layouts/rss.xml index 243ab90..ddc64ce 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -1,7 +1,7 @@ - @{{ .Site.Author.Handle }}’s {{ .Site.Title }}{{ with .Title }} - {{ . }}{{ end }} + @{{ .Site.Author.handle }}’s {{ .Site.Title }}{{ with .Title }} - {{ . }}{{ end }} {{ .Permalink }} All entries {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }} Hugo -- gohugo.io