feat(i18n): make dateFormat part of theme config
This commit is contained in:
parent
da112157cf
commit
4d0e260318
@ -13,6 +13,9 @@ DefaultContentLanguage = "en" # Theme i18n support
|
|||||||
[params]
|
[params]
|
||||||
mainSections = ["post"]
|
mainSections = ["post"]
|
||||||
favicon = ""
|
favicon = ""
|
||||||
|
[params.dateFormat]
|
||||||
|
published = "Jan 02, 2006"
|
||||||
|
lastUpdated = "Jan 02, 2006 15:04 MST"
|
||||||
[params.sidebar]
|
[params.sidebar]
|
||||||
emoji = "🍥"
|
emoji = "🍥"
|
||||||
avatar = "img/avatar.png"
|
avatar = "img/avatar.png"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<footer class="article-time">
|
<footer class="article-time">
|
||||||
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
|
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
|
||||||
{{- .Date.Format ( or .Site.Params.dateFormat "Jan 02, 2006" ) -}}
|
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||||
</time>
|
</time>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
<footer class="article-time">
|
<footer class="article-time">
|
||||||
{{ (resources.Get "icons/clock.svg").Content | safeHTML }}
|
{{ (resources.Get "icons/clock.svg").Content | safeHTML }}
|
||||||
<time class="article-time--published">
|
<time class="article-time--published">
|
||||||
{{- .Date.Format ( or .Site.Params.dateFormat "Jan 02, 2006" ) -}}
|
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||||
</time>
|
</time>
|
||||||
</footer>
|
</footer>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<section class="article-time">
|
<section class="article-time">
|
||||||
{{ (resources.Get "icons/clock.svg").Content | safeHTML }}
|
{{ (resources.Get "icons/clock.svg").Content | safeHTML }}
|
||||||
<span class="article-time--modified">
|
<span class="article-time--modified">
|
||||||
{{ T "lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat "Jan 02, 2006 15:04 MST" ) }}
|
{{ T "lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
|
||||||
</span>
|
</span>
|
||||||
</section>
|
</section>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
Loading…
Reference in New Issue
Block a user