Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/spech66/bootstrap-bp-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pech <windows@spech.de>2019-08-18 13:02:40 +0300
committerSebastian Pech <windows@spech.de>2019-08-18 13:02:40 +0300
commit1dadffd8e7faf84f360183558af9fb0d7500050c (patch)
tree6aa724b750117589bf82a0c095f269596f1de3a3
parent6d712fb48ac8825b4dc1d6fd5f76428ec32804cd (diff)
showListsGrouped switch added
-rw-r--r--README.md2
-rw-r--r--layouts/_default/list.html38
2 files changed, 32 insertions, 8 deletions
diff --git a/README.md b/README.md
index 6a2c584..624b301 100644
--- a/README.md
+++ b/README.md
@@ -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>