Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Fastbyte01/KeepIt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEumeryx <eumeryx@foxmail.com>2021-05-09 19:06:36 +0300
committerEumeryx <eumeryx@foxmail.com>2021-05-09 19:12:22 +0300
commit010d9098c1d8bc42ce83e7c7e44a4ee2fe45583e (patch)
treece5a6f37bb44d9320b149209d083966f3129b50c
parent7b37867d5ee9e892a3e64d09ac0ec84e85a377eb (diff)
add date format in config
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/_default/list.html4
-rw-r--r--layouts/_default/posts.html4
3 files changed, 6 insertions, 5 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 408bac3..bf88440 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -45,7 +45,8 @@ disqusShortname = "yourdiscussshortname"
subtitle = "A Hugo theme" # Subtitle
cdn_url = "" # Base CDN URL
home_mode = "" # post or other
-
+ dateFormatToUse = "" # set date format, default "2 January 2006"
+
google_verification = ""
bing_verification = ""
yandex_verification = ""
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index d7362e4..d9bfec5 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -9,10 +9,10 @@
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
<span class="archive-item-date">
- {{ .Date.Format "2 January 2006" }}
+ {{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}
</span>
</article>
{{ end }} {{ end }}
{{ partial "paginator.html" . }}
</div>
-{{end }} \ No newline at end of file
+{{end }}
diff --git a/layouts/_default/posts.html b/layouts/_default/posts.html
index 3496be6..4781eae 100644
--- a/layouts/_default/posts.html
+++ b/layouts/_default/posts.html
@@ -9,10 +9,10 @@
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
<span class="archive-item-date">
- {{ .Date.Format "2 January 2006" }}
+ {{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}
</span>
</article>
{{ end }} {{ end }}
{{ partial "paginator.html" . }}
</div>
-{{end }} \ No newline at end of file
+{{end }}