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

github.com/monkeyWzr/hugo-theme-cactus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Gouman <mail@nielsgouman.nl>2020-10-07 20:59:19 +0300
committerNiels Gouman <mail@nielsgouman.nl>2020-10-07 20:59:19 +0300
commit4a0c922e2281b8947f3c87babeea1bfb51db1e14 (patch)
tree36a6dd4915e5c6447f3b8cc341d3f6742602d0fe /layouts
parent56ff314e6f338dc851040636e2735118768ab6b4 (diff)
Create option to disable pagination, and display all posts in the archive
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index e674a11..e8c3e31 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,7 +1,13 @@
{{ define "main"}}
<div id="archive">
<ul class="post-list">
- {{ range (sort .Paginator.Pages "Date" "desc") }}
+
+ {{ $pages := .Paginator.Pages }}
+ {{ if .Site.Params.showAllPostsArchive }}
+ {{ $pages = .Pages }}
+ {{ end }}
+
+ {{ range (sort $pages "Date" "desc") }}
{{ $pageYear := (.Date.Format "2006") }}
{{ if (ne $pageYear ($.Scratch.Get "year")) }}
{{ $.Scratch.Set "year" $pageYear }}
@@ -17,6 +23,8 @@
</li>
{{ end }}
</ul>
- {{ partial "pagination.html" . }}
+ {{ if eq .Site.Params.showAllPostsArchive false }}
+ {{ partial "pagination.html" . }}
+ {{ end }}
</div>
{{ end }} \ No newline at end of file