Merge pull request #18 from vxnick/override-single-datetime

Allow the date/time format on the single template to be overridden
This commit is contained in:
Francesco Tomaselli 2024-09-02 22:50:26 +02:00 committed by GitHub
commit 219f231f12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@
<p class="single-readtime">
{{ with .Date }}
{{ $dateMachine := . | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := . | time.Format ":date_long" }}
{{ $dateHuman := . | time.Format (default ":date_long" $.Site.Params.singleDateFormat) }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
{{end}}