1
0
Fork 0
mirror of https://github.com/panr/hugo-theme-terminal.git synced 2025-03-14 18:29:03 +03:00

layouts/partials: post-date: Add support for created date prefix.

With this, one can set prefix for creation date from the config using
"createdDatePrefix".

In case it's not set, no prefix is set, which preserves the existing
behaviour.

Signed-off-by: Siddh Raman Pant <25429745+siddhpant@users.noreply.github.com>
This commit is contained in:
Siddh Raman Pant 2025-01-26 14:34:28 +05:30
parent 43309b7f31
commit 5c0aeac657
No known key found for this signature in database
GPG key ID: 7ADE987C39665DB4

View file

@ -1,3 +1,8 @@
<!-- Ensure delimited by hyphen to remove leading and trailing whitespace. -->
{{- if $.Site.Params.createdDatePrefix -}}
{{- $.Site.Params.createdDatePrefix -}}
&nbsp;
{{- end -}}
{{- .Date.Format (or .Params.dateFormat $.Site.Params.dateFormat "2006-01-02") -}}