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

github.com/queensferryme/hugo-theme-texify.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQueensferry <queensferry.me@gmail.com>2021-02-26 05:59:26 +0300
committerQueensferry <queensferry.me@gmail.com>2021-02-26 05:59:26 +0300
commit43015aad933eba828e9dc1c944c20ce5867f888c (patch)
treea09296d525e159a061bee34fe59719b75560d9d7
parent71150357b9d53cc2a030961098ea58be18b1a071 (diff)
feat: add option for date format (#7)
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/_default/index.html2
-rw-r--r--layouts/_default/list.html2
3 files changed, 4 insertions, 3 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index d6d7be1..5bc10ca 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -2,7 +2,7 @@ baseURL = "https://example.com/"
defaultContentLanguage = "en"
hasCJKLanguage = true
languageCode = "en"
-paginate = 4
+paginate = 5
theme = "hugo-theme-texify"
title = "TeXify"
@@ -37,6 +37,7 @@ name = "author"
[params]
customCSS = []
+ dateFormat = "2006-01-02"
description = "an example site for hugo theme TeXify"
enableFullRSS = true
enableMathjax = true
diff --git a/layouts/_default/index.html b/layouts/_default/index.html
index 69c5b9a..4c88535 100644
--- a/layouts/_default/index.html
+++ b/layouts/_default/index.html
@@ -15,7 +15,7 @@
<div class="post">
<h2>
<a href="{{ .Permalink }}">{{ .Title }}</a>
- <time>{{ .PublishDate.Format "2006-01-02" }}</time>
+ <time>{{ .PublishDate.Format .Site.Params.dateFormat }}</time>
</h2>
{{ if ne .Params.tags nil }}
<div>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index ba211bf..591053f 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -19,7 +19,7 @@
{{ range .Pages }}
<li>
<a class="link" href={{ .RelPermalink }}>{{ .Title }}</a>
- <time>{{ .PublishDate.Format "2006-01-02" }}</time>
+ <time>{{ .PublishDate.Format .Site.Params.dateFormat }}</time>
</li>
{{ end }}
</ul>