mirror of
https://github.com/Noettore/cocoa-eh-hugo-theme.git
synced 2025-10-15 03:36:41 +02:00
Add grouping by month and year in the blog section
This commit is contained in:
@@ -2,10 +2,17 @@
|
||||
<section class="main">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div class="page-heading">Blog</div>
|
||||
{{ range where .Data.Pages "Title" "Home"}}
|
||||
<div class="markdown">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<ul>
|
||||
{{ range .Data.Pages.ByPublishDate }}
|
||||
{{ if eq .Section "blog" }}
|
||||
{{ range first 5 (.Data.Pages.GroupByDate "Jan, 2006" "desc")}}
|
||||
{{ $nbPages := len (where .Pages "Section" "blog")}}
|
||||
{{ if ne $nbPages 0}}{{ .Key }}{{ end }}
|
||||
{{ range where .Pages.ByPublishDate "Section" "blog"}}
|
||||
{{ partial "li.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user