From 393db96bea67e644fbc95dffb618f4f0d675e7ac Mon Sep 17 00:00:00 2001 From: budparr Date: Sat, 3 Nov 2018 23:01:30 -0400 Subject: [PATCH 1/9] Add changelog --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ed0b4e3 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + + +## [2.34] - 2018-11-03 (@budparr) + +### Added + +- Add a changelog. + +### Changed + +- Run Ananke with Hugo v0.50 From 37bb3cc6991d3741dca08a52d41b1b3beecd1825 Mon Sep 17 00:00:00 2001 From: cdeguise Date: Sat, 3 Nov 2018 23:09:03 -0400 Subject: [PATCH 2/9] Removed hardcoded theme sample hero image. This will allow the user to "blank" out the hero default set in the config. The if statement for blank was unreachable. (#133) --- layouts/partials/site-header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index a1d3e31..0b9649e 100755 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -1,4 +1,4 @@ -{{ $featured_image := .Param "featured_image" | default "images/gohugo-default-sample-hero-image.jpg" }} +{{ $featured_image := .Param "featured_image"}} {{ if $featured_image }} {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} {{ $featured_image := (trim $featured_image "/") | absURL }} From 329facc53e863496255fd70dc42724aca441c9a5 Mon Sep 17 00:00:00 2001 From: budparr Date: Sat, 3 Nov 2018 23:12:26 -0400 Subject: [PATCH 3/9] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed0b4e3..92cbbcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,3 +14,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - Run Ananke with Hugo v0.50 +- Remove default background image so users can choose to not use one at all. #133 (cdeguise) \ No newline at end of file From fd22513cf1e1a6b6c9983b41cc5737b8585eca1d Mon Sep 17 00:00:00 2001 From: budparr Date: Sat, 3 Nov 2018 23:40:51 -0400 Subject: [PATCH 4/9] Add optional reading time/word count indication via PR #134 @looer Added config variable so this doesn't show up Show "reading time" and "word count" but only if one of the following are true: 1) A global config `params` value is set `show_reading_time = true` 2) A section front matter value is set `show_reading_time = true` 3) A page front matter value is set `show_reading_time = true` --- layouts/_default/single.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 89b61b2..73ed130 100755 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,6 +4,7 @@ {{ end }} {{ define "main" }} + {{ $section := .Site.GetPage "section" .Section }}
@@ -20,7 +21,17 @@ {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}} + + {{/* + Show "reading time" and "word count" but only if one of the following are true: + 1) A global config `params` value is set `show_reading_time = true` + 2) A section front matter value is set `show_reading_time = true` + 3) A page front matter value is set `show_reading_time = true` + */}} + {{ if (or (eq (.Param "show_reading_time") true) (eq $section.Params.show_reading_time true) )}} + - {{ .ReadingTime}} minutes read + - {{ .WordCount}} words + {{ end }}
From 01d1cff7d41ce6906708a2998aa13e3e7b4fcff3 Mon Sep 17 00:00:00 2001 From: budparr Date: Sat, 3 Nov 2018 23:42:19 -0400 Subject: [PATCH 5/9] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92cbbcb..a84d74f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,4 +14,5 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - Run Ananke with Hugo v0.50 -- Remove default background image so users can choose to not use one at all. #133 (cdeguise) \ No newline at end of file +- Remove default background image so users can choose to not use one at all. #133 (cdeguise) +- Add reading time and word count to pages, conditionally if set at global, page, or section level. (thanks to @looer for starting) \ No newline at end of file From ea219198c4ee59ff44b92bf191458488911b0115 Mon Sep 17 00:00:00 2001 From: budparr Date: Sat, 3 Nov 2018 23:47:09 -0400 Subject: [PATCH 6/9] Update Readme to include reading time --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 9a239f9..9975368 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,11 @@ For example, if your css files are `static/css/custom.css` and `static/css/custo custom_css = ["css/custom.css","css/custom2.css"] ``` +### Show Reading Time and Word Contributing + +If you add a key of `show_reading_time` true to either the Config Params, a page or section's front matter, articles will show the reading time and word count. + + ### Nearly finished In order to see your site in action, run Hugo's built-in local server. From f300f17d3cfbb9ecad547ef60b64b825bf875678 Mon Sep 17 00:00:00 2001 From: budparr Date: Sat, 3 Nov 2018 23:47:51 -0400 Subject: [PATCH 7/9] Tweak changelog wording --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a84d74f..70ddc9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,4 +15,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Run Ananke with Hugo v0.50 - Remove default background image so users can choose to not use one at all. #133 (cdeguise) -- Add reading time and word count to pages, conditionally if set at global, page, or section level. (thanks to @looer for starting) \ No newline at end of file +- Add reading time and word count to pages, conditionally if set at global, page, or section level with the `show_reading_time` key. (thanks to @looer for starting) From a57189d85fd554ba60d9a539c643220396cf56dc Mon Sep 17 00:00:00 2001 From: budparr Date: Sun, 4 Nov 2018 14:14:24 -0500 Subject: [PATCH 8/9] Add global background color class to footer (it's already on the header). Fixes #135 --- CHANGELOG.md | 4 ++++ layouts/partials/site-footer.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70ddc9f..81ab210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [2.35] - 2018-11-04 (@budparr) + +- Add global background color class to footer (it's already on the header). Fixes #135 + ## [2.34] - 2018-11-03 (@budparr) ### Added diff --git a/layouts/partials/site-footer.html b/layouts/partials/site-footer.html index 68e9688..d014f77 100755 --- a/layouts/partials/site-footer.html +++ b/layouts/partials/site-footer.html @@ -1,4 +1,4 @@ -