Skip to content

Commit

Permalink
Fix post templates to not show date if it is unset #50 (#51)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Smirl authored and curtiscde committed Aug 15, 2018
1 parent ffc507b commit b8d1ba6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions exampleSite/content/post/post.1.en.md
Expand Up @@ -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
+++
+++
Example of post with missing date property.
1 change: 0 additions & 1 deletion exampleSite/content/post/post.1.es.md
Expand Up @@ -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
+++
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/posts/featured.html
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/posts/list.html
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion 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": {
Expand Down

0 comments on commit b8d1ba6

Please sign in to comment.