Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/leonstafford/accessible-minimalism-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Stafford <me@ljs.dev>2020-09-14 07:47:19 +0300
committerLeon Stafford <me@ljs.dev>2020-09-14 07:47:19 +0300
commit4b6740ee2860ec1226db3d432bcc4dc8fef8c9b3 (patch)
treee46c2555c25e2a61668eae8c8a29636ab790aefd
parentb8f3a3d80c2b32d31295e28620dd12ec634319c3 (diff)
conditionally show author,date
-rw-r--r--layouts/partials/metadata.html12
1 files changed, 8 insertions, 4 deletions
diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html
index 2d475ca..fc43ecb 100644
--- a/layouts/partials/metadata.html
+++ b/layouts/partials/metadata.html
@@ -1,6 +1,10 @@
-<p>by {{if .Params.author}}{{.Params.author}}{{else}}{{ .Site.Params.author }}{{end}}</p>
+{{if .Params.author}}
+ <p>by {{.Params.author}}{{else}}{{ .Site.Params.author }}</p>
+{{end}}
-{{ $dateTime := .PublishDate.Format "2006-01-02" }}
-{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }}
-<p>{{ .PublishDate.Format $dateFormat }}</p>
+{{ if not .Date.IsZero }}
+ {{ $dateTime := .PublishDate.Format "2006-01-02" }}
+ {{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }}
+ <p>{{ .PublishDate.Format $dateFormat }}</p>
+{{end}}