mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-09 19:00:34 -05:00
🐹 Add date format option
This commit is contained in:
parent
af2b170429
commit
a49f7bd2db
3 changed files with 4 additions and 2 deletions
|
@ -14,6 +14,8 @@ pygmentsUseClasses = true
|
||||||
Profiles, backgrounds, favorite things etc.
|
Profiles, backgrounds, favorite things etc.
|
||||||
"""
|
"""
|
||||||
publicationYear = "2018"
|
publicationYear = "2018"
|
||||||
|
listPageDateFormat = "January, 2006" # See https://gohugo.io/functions/format/
|
||||||
|
singlePageDateFormat = "January 2, 2006"
|
||||||
# custom_css = ["/css/custom.css"]
|
# custom_css = ["/css/custom.css"]
|
||||||
# custom_js = ["/js/custom.js"]
|
# custom_js = ["/js/custom.js"]
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{ define "main"}}
|
{{ define "main"}}
|
||||||
<div>
|
<div>
|
||||||
{{ range $index, $value := .Pages.GroupByDate "January, 2006" }}
|
{{ range $index, $value := .Pages.GroupByDate .Site.Params.listPageDateFormat }}
|
||||||
{{ if (ne $index 0) }}
|
{{ if (ne $index 0) }}
|
||||||
<hr class="separator">
|
<hr class="separator">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{ define "main"}}
|
{{ define "main"}}
|
||||||
<div>
|
<div>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<p class="date">{{ .Date.Format "January 2, 2006" }}</p>
|
<p class="date">{{ .Date.Format .Site.Params.singlePageDateFormat }}</p>
|
||||||
<div class="markdown-body">
|
<div class="markdown-body">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue