diff options
author | Alex Williams <smirlie@googlemail.com> | 2018-08-15 16:54:01 +0300 |
---|---|---|
committer | Curtis Timson <curt@live.co.uk> | 2018-08-15 16:54:01 +0300 |
commit | b8d1ba600b75e232734f91c3d2530ce3091ab003 (patch) | |
tree | 2f556067ed7e537f41bfe0ff513d6e00ea7c925a | |
parent | ffc507b588220017b2d789d03dc35f2afc150142 (diff) |
Fix post templates to not show date if it is unset #50 (#51)4.2.1
* Fix post templates to not show date if it is unset #50
* Updating example site to have a post without date
* Remove date rather than setting to false
* Bump version and update content post description
-rw-r--r-- | exampleSite/content/post/post.1.en.md | 6 | ||||
-rw-r--r-- | exampleSite/content/post/post.1.es.md | 1 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/partials/posts/featured.html | 2 | ||||
-rw-r--r-- | layouts/partials/posts/list.html | 2 | ||||
-rw-r--r-- | package.json | 2 |
6 files changed, 7 insertions, 8 deletions
diff --git a/exampleSite/content/post/post.1.en.md b/exampleSite/content/post/post.1.en.md index 3822143..6e966e1 100644 --- a/exampleSite/content/post/post.1.en.md +++ b/exampleSite/content/post/post.1.en.md @@ -2,7 +2,7 @@ title = 'Primis eget imperdiet lorem' slug = 'post1' image = 'images/pic03.jpg' -date = "2017-04-22T00:00:00" -description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' +description = 'Example of post with missing date property' disableComments = true -+++
\ No newline at end of file ++++ +Example of post with missing date property.
\ No newline at end of file diff --git a/exampleSite/content/post/post.1.es.md b/exampleSite/content/post/post.1.es.md index 611f9bd..738283a 100644 --- a/exampleSite/content/post/post.1.es.md +++ b/exampleSite/content/post/post.1.es.md @@ -2,7 +2,6 @@ title = 'Primis eget imperdiet lorem - Versión Español' slug = 'post1' image = 'images/pic03.jpg' -date = "2017-04-22T00:00:00" description = 'Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis magna etiam.' disableComments = true +++ diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 991bcff..cae3cea 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -13,7 +13,7 @@ <!-- Post --> <section class="post"> <header class="major"> - {{ if .Date }} + {{ if not .Date.IsZero }} <span class="date">{{ .Date.Format "January 2, 2006" }}</span> {{ end }} <h1>{{ .Title }}</h1> diff --git a/layouts/partials/posts/featured.html b/layouts/partials/posts/featured.html index 53ad713..1a03c76 100644 --- a/layouts/partials/posts/featured.html +++ b/layouts/partials/posts/featured.html @@ -3,7 +3,7 @@ {{ range .firstpost }} <article class="post featured"> <header class="major"> - {{ if .Date }} + {{ if not .Date.IsZero }} <span class="date">{{ .Date.Format "January 2, 2006" }}</span> {{ end }} <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2> diff --git a/layouts/partials/posts/list.html b/layouts/partials/posts/list.html index 9bdfebc..8bce904 100644 --- a/layouts/partials/posts/list.html +++ b/layouts/partials/posts/list.html @@ -4,7 +4,7 @@ {{ range .posts.Pages }} <article> <header> - {{ if .Date }} + {{ if not .Date.IsZero }} <span class="date">{{ .Date.Format "January 2, 2006" }}</span> {{ end }} <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2> diff --git a/package.json b/package.json index 5fd8c43..c7762ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hugo-theme-massively", - "version": "4.2.0", + "version": "4.2.1", "description": "HTML5 UP theme Massively for Hugo", "main": "index.js", "scripts": { |