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

github.com/yanlinlin82/simple-style.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinlin Yan <yanlinlin82@gmail.com>2019-12-10 19:40:13 +0300
committerLinlin Yan <yanlinlin82@gmail.com>2019-12-10 19:40:13 +0300
commit415843185bf28b311433f05b1a2d8cc96d0ac36d (patch)
tree63b8ea50024ae490695d0567fe6e808e11943c7b
parentcba8831d5fd52a36ea21011bfceda5536f83478f (diff)
Check if date exists
-rw-r--r--layouts/_default/single.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 7238f8c..9a70507 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -3,12 +3,12 @@
<h1>{{ .Title }}</h1>
</div>
<div>
- {{ with .Date.Format "2006-01-02 15:04" -}}
- <div><span>{{ . }}</span></div>
+ {{ if .Date -}}
+ <div>{{ .Date.Format "2006-01-02 15:04" }}</span>
{{ end -}}
{{ if .Params.tags -}}
<div>
- {{ range .Params.tags }}
+ {{ range .Params.tags -}}
<span><a href="{{ "tags/" | relLangURL }}{{ . | urlize }}/">#{{ . }}</a></span>
{{ end -}}
</div>