From 010d9098c1d8bc42ce83e7c7e44a4ee2fe45583e Mon Sep 17 00:00:00 2001 From: Eumeryx Date: Mon, 10 May 2021 00:06:36 +0800 Subject: add date format in config --- exampleSite/config.toml | 3 ++- layouts/_default/list.html | 4 ++-- layouts/_default/posts.html | 4 ++-- 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 @@
{{ .Title }} - {{ .Date.Format "2 January 2006" }} + {{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}
{{ end }} {{ end }} {{ partial "paginator.html" . }} -{{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 @@
{{ .Title }} - {{ .Date.Format "2 January 2006" }} + {{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}
{{ end }} {{ end }} {{ partial "paginator.html" . }} -{{end }} \ No newline at end of file +{{end }} -- cgit v1.2.3