From 8262ab6f2d7b01e134fd3a4d945fbb77e54128bc Mon Sep 17 00:00:00 2001
From: Ghyslain Leclerc
Date: Wed, 28 Dec 2016 21:13:54 -0500
Subject: [PATCH 1/5] 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
From e455fb9170413f696e23572863a3d277bb0b5875 Mon Sep 17 00:00:00 2001
From: Ghyslain Leclerc
Date: Wed, 28 Dec 2016 21:28:07 -0500
Subject: [PATCH 2/5] Fixed the .Site.Author.name reference to use currently
recommended info.
Now uses .Site.Author.firstname and .Site.Author.lastname.
---
layouts/rss.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layouts/rss.xml b/layouts/rss.xml
index ddc64ce..2d352a9 100644
--- a/layouts/rss.xml
+++ b/layouts/rss.xml
@@ -15,7 +15,7 @@
{{ .Title }}
{{ .Permalink }}
{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}
- {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}
+ {{ with .Site.Author.email }}{{.}}{{end}} ({{ with .Site.Author.firstname }}{{.}}{{ end }} {{ with .Site.Author.lastname }}{{.}}{{end}}){{ .Permalink }}{{ .Content | html }}
From bf5081d4eee91ed79d2dc273772a4130114e65f6 Mon Sep 17 00:00:00 2001
From: Ghyslain Leclerc
Date: Wed, 28 Dec 2016 21:33:27 -0500
Subject: [PATCH 3/5] Made the Flickr images in the footer optional.
If the FlickID parameter in the Author section in the config is not set or if it
is set to the empty string, the section is not inserted in the footer.
---
layouts/partials/page_footer.html | 2 ++
1 file changed, 2 insertions(+)
diff --git a/layouts/partials/page_footer.html b/layouts/partials/page_footer.html
index b76e34f..19a39b5 100644
--- a/layouts/partials/page_footer.html
+++ b/layouts/partials/page_footer.html
@@ -6,11 +6,13 @@
{{ partial "bio.html" . }}
+ {{ if isset .Site.Author "flickrid" | and ( not ( eq .Site.Author.flickrid "" ) ) }}