Skip to content

Commit

Permalink
fix: hugo error when dateFormat parameter is not set, closes #128
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-sid committed Sep 25, 2023
1 parent 218ea44 commit 730ced7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/partials/postCard.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h4 class="post-item-title">
</h4>
{{/* format date string to create an ISO 8601 string */}}
{{ $ISO_date := "2006-01-02T15:04:05Z0700" }}
{{ $configDateFormat := .Site.Params.dateFormat }}
{{ $configDateFormat := .Site.Params.dateFormat | default "2 Jan 2006" }}
<time class="post-item-meta" datetime="{{ dateFormat $ISO_date .Date }}">
{{ time.Format $configDateFormat .Date }}
{{/* OLD FORMAT: .Date.Format $configDateFormat */}}
Expand Down

0 comments on commit 730ced7

Please sign in to comment.