mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
layouts: Add DateFormat parameter (#39)
* User can change Date Format to be displayed in Front Matter * Formats supported by Hugo can be found here: https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference
This commit is contained in:
parent
a980d10bfc
commit
db52aa9942
@ -22,7 +22,7 @@
|
||||
{{- .Title | markdownify }}
|
||||
</h3>
|
||||
<div class="archive-meta">
|
||||
<time>{{ .Date.Format "January 2, 2006" }}</time>
|
||||
<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time>
|
||||
{{- if $.Site.Params.ShowReadingTime }} ·
|
||||
{{- $default_txt := print .ReadingTime " " "min" }}
|
||||
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
||||
|
@ -52,7 +52,7 @@
|
||||
</section>
|
||||
{{- end }}
|
||||
<footer class="entry-footer">
|
||||
<time>{{ .Date.Format "January 2, 2006" }}</time>
|
||||
<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time>
|
||||
{{- if $.Site.Params.ShowReadingTime }} ·
|
||||
{{- $default_txt := print .ReadingTime " " "min" }}
|
||||
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
||||
|
@ -8,7 +8,7 @@
|
||||
</h1>
|
||||
{{- if .Params.hideMeta }}{{ else }}
|
||||
<div class="post-meta">
|
||||
<time>{{ .Date.Format "January 2, 2006" }}</time>
|
||||
<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time>
|
||||
{{- if $.Site.Params.ShowReadingTime -}} ·
|
||||
{{- $default_txt := print .ReadingTime " " "min" }}
|
||||
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user