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

github.com/heyeshuang/hugo-theme-tokiwa.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author贺叶霜 <i@heysh.xyz>2021-04-20 03:31:13 +0300
committerGitHub <noreply@github.com>2021-04-20 03:31:13 +0300
commit1f9569e3d22b0a0006c765cf1a5696d8f07288d0 (patch)
treeedd77d484589116e4f45af3a9b75e18645a69318
parent4ee5ce27f1c378b50ecbafdad3f08850d8a77be0 (diff)
parent0bd7f077982facb19ab713ffe2d9ed7014534c43 (diff)
Merge pull request #13 from josephmr/date
Add param for configuring the date format of posts
-rw-r--r--README.md3
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/page-header.html4
-rw-r--r--layouts/partials/summary.html4
4 files changed, 7 insertions, 5 deletions
diff --git a/README.md b/README.md
index 6e3a882..25d525a 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,7 @@ math = true # for introducing $KaTEX$
env = "production" # for Google Analytics and DISQUS.
useChineseFonts = true # for font Noto Serif etc.
bannerFont = "fonts/exampleFont" # custom your own font for the title.
+postDateFormat = "2006-1-2" # override custom date format posts.
[menu]
# Shown in the side menu.
@@ -101,4 +102,4 @@ Thanks.
## LICENSE
-MIT \ No newline at end of file
+MIT
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 8e83a89..1932f49 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -28,6 +28,7 @@ favicon = "img/favicon-32x32.png"
fuse = true # for searchbox. "JSON" must added to output contents. See [outputs].
math = true # for introducing $KaTEX$
useChineseFonts = true
+postDateFormat = "2006-1-2"
[menu]
# Shown in the side menu.
diff --git a/layouts/partials/page-header.html b/layouts/partials/page-header.html
index 6aeb563..8aef02b 100644
--- a/layouts/partials/page-header.html
+++ b/layouts/partials/page-header.html
@@ -13,8 +13,8 @@
{{- partial "tags.html" . -}}
<time class="text-eucalyptus-500 md:text-right md:flex-grow font-light pl-4"
datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
- {{- .Date.Format "2006-1-2 15:04" -}}
+ {{- .Date.Format (.Site.Params.PostDateFormat | default "2006-1-2 15:04") -}}
</time>
</div>
{{ partial "toc.html" . }}
-<hr /> \ No newline at end of file
+<hr />
diff --git a/layouts/partials/summary.html b/layouts/partials/summary.html
index 935b91a..7d91d48 100644
--- a/layouts/partials/summary.html
+++ b/layouts/partials/summary.html
@@ -17,7 +17,7 @@
{{- partial "tags.html" . -}}
<time class="text-eucalyptus-500 md:text-right md:flex-grow font-light"
datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
- {{- .Date.Format "2006-1-2 15:04" -}}
+ {{- .Date.Format (.Site.Params.PostDateFormat | default "2006-1-2 15:04") -}}
</time>
</div>
-</div> \ No newline at end of file
+</div>