hugo-theme-terminal/layouts/partials/post-lastmod.html
KatieTheDev c779a70834
Add configurable timestamping for posts (#494)
* Add configurable timestamping

* Add attribution for configurable timestamping

* Add new post timestamp options to example hugo.toml

* All date formats are now set by single config option in site or page config

* Add post timestamp explainer and examples to example config file

* Add configurable timestamping value to frontmatter archetype

* Explain possible timezone rendering issue with new time formatting

* Fix bug concerning time/date tokens

* Convert datestamps to work with a partial

* Fix issue with lastmod being equal to date

* Add Updated prefix functionality
2024-11-19 09:09:43 +01:00

10 lines
No EOL
371 B
HTML

{{- $date := .Lastmod -}}
{{- with .Params.dateFormat -}}
{{- $date | time.Format . -}}
{{- else -}}
{{- with .Site.Params.dateFormat -}}
[{{- or $.Site.Params.updatedDatePrefix "Updated: " }} {{ $date | time.Format . -}}]
{{- else -}}
[{{- or $.Site.Params.updatedDatePrefix "Updated: " }} {{ $date | time.Format "2006-01-02" -}}]
{{- end -}}
{{- end -}}