Add dateFormat option. Close #5
This commit is contained in:
parent
63b73e6d2b
commit
391fe8e5b1
@ -54,6 +54,7 @@ params:
|
||||
- images/og-featured.png
|
||||
customCSS:
|
||||
- css/my.css
|
||||
dateFormat: "2006-01-02"
|
||||
```
|
||||
|
||||
### Check your site
|
||||
|
@ -1,5 +1,10 @@
|
||||
{{ $dateFormat := "2006-01-02" }}
|
||||
{{ if .Site.Params.dateFormat }}
|
||||
{{ $dateFormat = .Site.Params.dateFormat }}
|
||||
{{ end }}
|
||||
|
||||
<div class="article-info">
|
||||
{{ if .Params.date }}
|
||||
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
|
||||
<div class="article-date">{{ .Params.date.Format $dateFormat }}</div>
|
||||
{{ end }}
|
||||
</div>
|
@ -1,6 +1,11 @@
|
||||
{{ $dateFormat := "2006-01-02" }}
|
||||
{{ if .Site.Params.dateFormat }}
|
||||
{{ $dateFormat = .Site.Params.dateFormat }}
|
||||
{{ end }}
|
||||
|
||||
<div class="article-info">
|
||||
{{ if .Params.date }}
|
||||
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
|
||||
<div class="article-date">{{ .Params.date.Format $dateFormat }}</div>
|
||||
{{ end }}
|
||||
<div class="article-taxonomies">
|
||||
{{ if .Params.categories }}
|
||||
|
Loading…
Reference in New Issue
Block a user