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:
Fredrik Jonsson 2020-12-29 14:48:59 +01:00 • committed by GitHub
commit 0f242d80a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -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">

View file

@ -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">

View 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 }}

View file

@ -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>