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