diff options
author | Daniel Jonsson <dannie92@gmail.com> | 2017-02-04 10:47:37 +0300 |
---|---|---|
committer | Juraj Bubniak <juraj.bubniak@gmail.com> | 2017-02-04 10:47:37 +0300 |
commit | 2e4ed12f4e738e64a5f1c07a85a00e8d9582d761 (patch) | |
tree | 49624c89bc49f13d85da7e308d7f9bbceef38248 /layouts | |
parent | 6450d6b71efa9b0dce7e0c404f93f1f8e55081d4 (diff) |
Add config option to customize the date format (#26)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/post-header.html | 2 | ||||
-rw-r--r-- | layouts/partials/post-stub.html | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/post-header.html b/layouts/partials/post-header.html index cec1e5e..3373ddd 100644 --- a/layouts/partials/post-header.html +++ b/layouts/partials/post-header.html @@ -4,7 +4,7 @@ <p class="post-description" itemprop="description">{{ .Description }}</p> {{ end }} <p class="post-date"> - <span>Published <time datetime="{{ .Date.Format "2006-01-02" }}" itemprop="datePublished">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></span> + <span>Published <time datetime="{{ .Date.Format "2006-01-02" }}" itemprop="datePublished">{{ dateFormat (default "Mon, Jan 2, 2006" .Site.Params.dateFormat) .Date }}</time></span> <span>by</span> <span itemscope="" itemprop="author" itemtype="https://schema.org/Person"> <span itemprop="name"> diff --git a/layouts/partials/post-stub.html b/layouts/partials/post-stub.html index c0004cf..2bddd11 100644 --- a/layouts/partials/post-stub.html +++ b/layouts/partials/post-stub.html @@ -1,7 +1,7 @@ <li class="post-stub" itemprop="blogPost" itemscope="" itemtype="https://schema.org/BlogPosting"> <a href="{{ .Permalink }}" itemprop="url" title="Go to post detail"> <h4 class="post-stub-title" itemprop="name">{{ .Title }}</h4> - <time class="post-stub-date" datetime="{{ .Date.Format "2006-01-02" }}">Published {{ .Date.Format "Mon, Jan 2, 2006" }}</time> + <time class="post-stub-date" datetime="{{ .Date.Format "2006-01-02" }}">Published {{ dateFormat (default "Mon, Jan 2, 2006" .Site.Params.dateFormat) .Date }}</time> {{ with .Params.featured }} <span class="post-stub-tag">Featured</span> {{ end }} |