Skip to content

Commit

Permalink
Merge pull request #738 from okkur/fixDateFormat
Browse files Browse the repository at this point in the history
Fix date_format config
  • Loading branch information
stp-ip authored Apr 14, 2020
2 parents 265148c + 061a9c0 commit 8b10f68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions layouts/partials/helpers/publish-date.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- $date := .root.Date | default .root.Lastmod }}
{{- $date_format := .root.Site.Params.date_format | default "2006-01-02" }}

{{- if not (eq .badge false) }}
<span class="publish-date badge mr-1
{{- if (eq $.background "dark") -}}
Expand All @@ -7,7 +9,7 @@
{{- printf " badge-%s" "primary" -}}
{{- end -}}">
<time datetime="{{ $date }}" itemprop="datePublished dateModified">
{{- $date.Format ($.site.Params.date_format | default "2006-01-02") -}}
{{- $date.Format $date_format -}}
</time>
</span>
{{- else }}
Expand All @@ -16,7 +18,7 @@
{{- printf " badge-%s" "light" -}}
{{- end -}}">
<time datetime="{{ $date }}" itemprop="datePublished dateModified">
{{- $date.Format ($.site.Params.date_format | default "2006-01-02") -}}
{{- $date.Format $date_format -}}
</time>
</span>
{{- end -}}

0 comments on commit 8b10f68

Please sign in to comment.