Skip to content

Commit

Permalink
Fix date_format config
Browse files Browse the repository at this point in the history
  • Loading branch information
stp-ip authored Apr 12, 2020
1 parent 2a95b5d commit 061a9c0
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 061a9c0

Please sign in to comment.