diff options
author | Sebastian Pech <windows@spech.de> | 2019-08-18 13:02:40 +0300 |
---|---|---|
committer | Sebastian Pech <windows@spech.de> | 2019-08-18 13:02:40 +0300 |
commit | 1dadffd8e7faf84f360183558af9fb0d7500050c (patch) | |
tree | 6aa724b750117589bf82a0c095f269596f1de3a3 | |
parent | 6d712fb48ac8825b4dc1d6fd5f76428ec32804cd (diff) |
showListsGrouped switch added
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | layouts/_default/list.html | 38 |
2 files changed, 32 insertions, 8 deletions
@@ -20,6 +20,8 @@ Most settings should be done with hugo specific variables. There are only a few * `startPageColumns = true` will show the start page in a Masonry-like mode. * `customDateFormat` to override the date format. +* `showListsGrouped` to add headers for every year. +* `showPostSummary` only show a summary on index and lists. ![startPageColumns = true](https://raw.githubusercontent.com/spech66/bootstrap-bp-hugo-theme/master/images/tn.png) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 1cd3f9d..cf2f5fb 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,17 +3,39 @@ <div class="container mt-3 mb-3"> <h1>{{ .Title }}</h1> - {{ if .Site.Params.startPageColumns }} - <div class="card-columns"> - {{ range .Pages }} - {{- partial "content_summary.html" . -}} + {{ if .Site.Params.showListsGrouped }} + {{ if .Site.Params.startPageColumns }} + {{ range .Pages.GroupByDate "2006" }} + <h2>{{ .Key }}</h2> + <div class="card-columns"> + {{ range .Pages }} + {{- partial "content_summary.html" . -}} + {{ end }} + </div> + {{ end }} + {{ else }} + {{ range .Pages.GroupByDate "2006" }} + <h2>{{ .Key }}</h2> + {{ range .Pages }} + <div class="mb-3"> + {{- partial "content_summary.html" . -}} + </div> + {{ end }} {{ end }} - </div> + {{ end }} {{ else }} - {{ range .Pages }} - <div class="mb-3"> - {{- partial "content_summary.html" . -}} + {{ if .Site.Params.startPageColumns }} + <div class="card-columns"> + {{ range .Pages }} + {{- partial "content_summary.html" . -}} + {{ end }} </div> + {{ else }} + {{ range .Pages }} + <div class="mb-3"> + {{- partial "content_summary.html" . -}} + </div> + {{ end }} {{ end }} {{ end }} </div> |