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>
|
||||
<h1 class="hidden">{{ .Title }}</h1>
|
||||
<p>
|
||||
{{ with $.Param "author" }}<span class="author">{{ . }}</span> – {{ end -}}
|
||||
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
|
||||
{{ partial "author-date" . }}
|
||||
</p>
|
||||
</header>
|
||||
<div class="content">
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
<header>
|
||||
<h2 class="hidden">{{ .Title }}</h2>
|
||||
<p><a href="{{ .RelPermalink }}">
|
||||
{{ with $.Param "author" }}<span class="author">{{ . }}</span> – {{ end -}}
|
||||
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
|
||||
{{ partial "author-date" . }}
|
||||
</a></p>
|
||||
</header>
|
||||
<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">
|
||||
{{ with $.Param "author" }}<span class="author" itemprop="author">{{ . }}</span> – {{ end -}}
|
||||
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
|
||||
{{ partial "author-date" . }}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue