🌐 Use language specific date formats

This commit is contained in:
James Panther
2022-01-11 12:13:18 +11:00
parent 9c8601102c
commit 6eab5f95fb
8 changed files with 11 additions and 7 deletions
+5 -1
View File
@@ -1,10 +1,14 @@
languageCode = "en"
languageName = "English"
displayName = "EN"
htmlCode = "en"
weight = 1
title = "Congo EN"
title = "Congo"
# copyright = "Copy, _right?_ :thinking_face:"
dateFormat = "2 January 2006"
[author]
# name = "Your name here"
# image = "img/author.jpg"
+1 -1
View File
@@ -1,3 +1,3 @@
[hugoVersion]
extended = false
min = "0.86.1"
min = "0.87.0"
-1
View File
@@ -19,7 +19,6 @@ colorScheme = "congo"
[article]
showDate = true
dateFormat = "2 January 2006"
showAuthor = true
showBreadcrumbs = false
showDraftLabel = true
+1 -1
View File
@@ -3,7 +3,7 @@
# https://jpanther.github.io/congo/docs/getting-started/
theme = "congo"
defaultContentLanguage = "en-au"
defaultContentLanguage = "en"
enableEmoji = true
enableRobotsTXT = true
@@ -7,6 +7,8 @@ weight = 1
title = "Congo"
# copyright = "Copy, _right?_ :thinking_face:"
dateFormat = "2 January 2006"
[author]
name = "Congo"
image = "img/author.jpg"
-1
View File
@@ -19,7 +19,6 @@ mainSections = ["samples"]
[article]
showDate = true
dateFormat = "2 January 2006"
showAuthor = true
showBreadcrumbs = true
showDraftLabel = true
+2 -2
View File
@@ -1,10 +1,10 @@
<time datetime="{{ .Date }}">
{{- .Date.Format (.Site.Params.article.dateFormat | default "2 January 2006") -}}
{{- .Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long") -}}
</time>
{{ if .Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false) }}
&nbsp;(Updated:&nbsp;
<time datetime="{{ .Lastmod }}">
{{- .Lastmod.Format (.Site.Params.article.dateFormat | default "2 January 2006") -}}
{{- .Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long") -}}
</time>
)
{{ end }}