diff --git a/README.md b/README.md index 4c6358e..e1db353 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ params: - images/og-featured.png customCSS: - css/my.css + dateFormat: "2006-01-02" ``` ### Check your site diff --git a/layouts/partials/articleInfoDate.html b/layouts/partials/articleInfoDate.html index 02c5b13..a428163 100644 --- a/layouts/partials/articleInfoDate.html +++ b/layouts/partials/articleInfoDate.html @@ -1,5 +1,10 @@ +{{ $dateFormat := "2006-01-02" }} +{{ if .Site.Params.dateFormat }} + {{ $dateFormat = .Site.Params.dateFormat }} +{{ end }} +
{{ if .Params.date }} -
{{ .Params.date.Format "2006-01-02" }}
+
{{ .Params.date.Format $dateFormat }}
{{ end }}
\ No newline at end of file diff --git a/layouts/partials/articleInfoFull.html b/layouts/partials/articleInfoFull.html index d3bf36f..512e371 100644 --- a/layouts/partials/articleInfoFull.html +++ b/layouts/partials/articleInfoFull.html @@ -1,6 +1,11 @@ +{{ $dateFormat := "2006-01-02" }} +{{ if .Site.Params.dateFormat }} + {{ $dateFormat = .Site.Params.dateFormat }} +{{ end }} +
{{ if .Params.date }} -
{{ .Params.date.Format "2006-01-02" }}
+
{{ .Params.date.Format $dateFormat }}
{{ end }}
{{ if .Params.categories }}