Merge pull request #36 from fschrempf/post-hide-unset-date
Don't show date of post when it is not set
This commit is contained in:
commit
0f242d80a5
4 changed files with 6 additions and 6 deletions
|
|
@ -4,8 +4,7 @@
|
||||||
<header>
|
<header>
|
||||||
<h1 class="hidden">{{ .Title }}</h1>
|
<h1 class="hidden">{{ .Title }}</h1>
|
||||||
<p>
|
<p>
|
||||||
{{ with $.Param "author" }}<span class="author">{{ . }}</span> – {{ end -}}
|
{{ partial "author-date" . }}
|
||||||
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
|
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<h2 class="hidden">{{ .Title }}</h2>
|
<h2 class="hidden">{{ .Title }}</h2>
|
||||||
<p><a href="{{ .RelPermalink }}">
|
<p><a href="{{ .RelPermalink }}">
|
||||||
{{ with $.Param "author" }}<span class="author">{{ . }}</span> – {{ end -}}
|
{{ partial "author-date" . }}
|
||||||
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
|
|
||||||
</a></p>
|
</a></p>
|
||||||
</header>
|
</header>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
|
||||||
3
layouts/partials/author-date.html
Normal file
3
layouts/partials/author-date.html
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{{ with $.Param "author" }}<span class="author" itemprop="author">{{ . }}</span>{{ end -}}
|
||||||
|
{{ if and .Date ($.Param "author") }} - {{ end -}}
|
||||||
|
{{ with .Date }}<time class="created-date" datetime="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ .Format ($.Param "dateformat" | default "2 January, 2006") }}</time>{{ end }}
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="submitted">
|
<div class="submitted">
|
||||||
{{ with $.Param "author" }}<span class="author" itemprop="author">{{ . }}</span> – {{ end -}}
|
{{ partial "author-date" . }}
|
||||||
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue