From 391fe8e5b1435978b95c471e1ce0be5cd3bc211e Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Sun, 24 May 2020 22:55:32 +0300 Subject: [PATCH] Add dateFormat option. Close #5 --- README.md | 1 + layouts/partials/articleInfoDate.html | 7 ++++++- layouts/partials/articleInfoFull.html | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) 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 }} - + {{ 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 }} - + {{ end }}
{{ if .Params.categories }}