Skip to content

Commit 010d909

Browse files
committed
add date format in config
1 parent 7b37867 commit 010d909

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

exampleSite/config.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ disqusShortname = "yourdiscussshortname"
4545
subtitle = "A Hugo theme" # Subtitle
4646
cdn_url = "" # Base CDN URL
4747
home_mode = "" # post or other
48-
48+
dateFormatToUse = "" # set date format, default "2 January 2006"
49+
4950
google_verification = ""
5051
bing_verification = ""
5152
yandex_verification = ""

layouts/_default/list.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ <h3>{{ .Key }}</h3>
99
<article class="archive-item">
1010
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
1111
<span class="archive-item-date">
12-
{{ .Date.Format "2 January 2006" }}
12+
{{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}
1313
</span>
1414
</article>
1515
{{ end }} {{ end }}
1616
{{ partial "paginator.html" . }}
1717
</div>
18-
{{end }}
18+
{{end }}

layouts/_default/posts.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ <h3>{{ .Key }}</h3>
99
<article class="archive-item">
1010
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
1111
<span class="archive-item-date">
12-
{{ .Date.Format "2 January 2006" }}
12+
{{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}
1313
</span>
1414
</article>
1515
{{ end }} {{ end }}
1616
{{ partial "paginator.html" . }}
1717
</div>
18-
{{end }}
18+
{{end }}

0 commit comments

Comments
 (0)