Commit ddea1189 authored by Sam Neubardt's avatar Sam Neubardt

Don't show "PUBLISHED ON" for content without dates

Otherwise posts without a `date` attribute in their front matter will
use a zero `time.Time`.
This results in the post showing `PUBLISHED ON JAN 1, 0001`
parent 79d8f2c1
......@@ -5,7 +5,7 @@
{{ if ne .Params.showpagemeta false }}
<div class="col-md-12">
<h6 class="text-left meta">
PUBLISHED ON {{ .Date.Format .Site.Params.dateformat | upper }}
{{ if not .Date.IsZero }} PUBLISHED ON {{ .Date.Format .Site.Params.dateformat | upper }} {{end}}
{{ if isset .Params "categories" }}
{{ $total := len .Params.categories }}
{{ if gt $total 0 }}
......
......@@ -4,7 +4,7 @@
<li class="list-entry">
<a class="list-entry-link" href="{{ .Permalink }}">{{ .Title }}</a>
<p class="meta">
{{ .Date.Format .Site.Params.dateformat | upper }}
{{ if not .Date.IsZero }} {{ .Date.Format .Site.Params.dateformat | upper }} {{end}}
<span class="category">
{{ if isset .Params "categories" }}
{{ $total := len .Params.categories }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment