mirror of
https://github.com/tomfran/typo.git
synced 2025-04-25 21:19:55 +03:00
Allow the date/time format on the single template to be overridden
Example: ```toml [params] singleDateFormat = '2 January 2006' ```
This commit is contained in:
parent
b64eb091f4
commit
a2e01c16dd
1 changed files with 2 additions and 2 deletions
|
@ -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}}
|
||||
|
||||
|
@ -88,4 +88,4 @@
|
|||
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue