Fixed PublishDate inconsistencies in my custom theme
This commit is contained in:
parent
7e5535e2f6
commit
5e4d09a6d7
2 changed files with 15 additions and 1 deletions
|
@ -7,6 +7,11 @@ enableGitInfo = true
|
||||||
paginate = 32
|
paginate = 32
|
||||||
rssLimit = 16
|
rssLimit = 16
|
||||||
|
|
||||||
|
[frontmatter]
|
||||||
|
date = ['date', 'lastmod', ':git']
|
||||||
|
lastmod = [':git', 'lastmod', 'date']
|
||||||
|
publishDate = ['date', 'lastmod']
|
||||||
|
|
||||||
[markup]
|
[markup]
|
||||||
[markup.highlight]
|
[markup.highlight]
|
||||||
anchorLineNos = false
|
anchorLineNos = false
|
||||||
|
|
|
@ -12,14 +12,23 @@
|
||||||
{{$.Scratch.Set "blog-pages" .Pages }}
|
{{$.Scratch.Set "blog-pages" .Pages }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006")}}
|
{{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByPublishDate "2006")}}
|
||||||
{{ range $pag.PageGroups }}
|
{{ range $pag.PageGroups }}
|
||||||
|
{{ if ne .Key "0001" }}
|
||||||
<h2>{{ T "post_posts_in" }} {{ .Key }}</h2>
|
<h2>{{ T "post_posts_in" }} {{ .Key }}</h2>
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
<li>{{ .PublishDate.Format "2006-01-02" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a> : {{ .Description }}</li>
|
<li>{{ .PublishDate.Format "2006-01-02" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a> : {{ .Description }}</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
{{ else }}
|
||||||
|
<h2>Docs</h2>
|
||||||
|
<ul>
|
||||||
|
{{ range .Pages }}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a> : {{ .Description }}</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ partial "pagination.html" . }}
|
{{ partial "pagination.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue