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 }}
|
{{- .Title | markdownify }}
|
||||||
</h3>
|
</h3>
|
||||||
<div class="archive-meta">
|
<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 }} ·
|
{{- if $.Site.Params.ShowReadingTime }} ·
|
||||||
{{- $default_txt := print .ReadingTime " " "min" }}
|
{{- $default_txt := print .ReadingTime " " "min" }}
|
||||||
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
</section>
|
</section>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<footer class="entry-footer">
|
<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 }} ·
|
{{- if $.Site.Params.ShowReadingTime }} ·
|
||||||
{{- $default_txt := print .ReadingTime " " "min" }}
|
{{- $default_txt := print .ReadingTime " " "min" }}
|
||||||
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</h1>
|
</h1>
|
||||||
{{- if .Params.hideMeta }}{{ else }}
|
{{- if .Params.hideMeta }}{{ else }}
|
||||||
<div class="post-meta">
|
<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 -}} ·
|
{{- if $.Site.Params.ShowReadingTime -}} ·
|
||||||
{{- $default_txt := print .ReadingTime " " "min" }}
|
{{- $default_txt := print .ReadingTime " " "min" }}
|
||||||
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue