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

github.com/mattbutton/silhouette-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt <kendoran@gmail.com>2019-08-20 13:21:54 +0300
committerMatt <kendoran@gmail.com>2019-08-20 13:21:54 +0300
commitdd7a93f328c6273fa88a8300eacb7c550e9d49af (patch)
tree4f2b796bc2e455807b7ce6871fbcd20f76449ea4
parentbe305fbae0c401e8c574e38105d500096161d387 (diff)
Fixed filtering by switching back to using .Pages when not .IsHome
-rw-r--r--layouts/_default/list.html9
1 files changed, 6 insertions, 3 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index e93d33a..7e31f70 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -79,9 +79,12 @@
{{ end }}
{{ define "main" }}
<div class="container mt-4 mb-4 recent-posts">
- {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
- {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) 10 }}
- {{ range $paginator.Pages }}
+ {{ $pages := .Pages }}
+ {{ if .IsHome }}
+ {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
+ {{ end }}
+ {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) 10 }}
+ {{ range $paginator.Pages }}
<article class="post">
<a class="title" href="{{ .Permalink }}"><h2>{{ .Title }}</h2></a>
{{ partial "post-meta" . }}