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 12:43:32 +0300
committerMatt <kendoran@gmail.com>2019-08-20 12:43:32 +0300
commitbe305fbae0c401e8c574e38105d500096161d387 (patch)
tree968bf5a21f8fbb562be73918c52115996903ab33
parentc1b4e06297ec6a3c348964742a3710de89f1b6f3 (diff)
Switched to using RegularPages and mainSections
More info here: https://github.com/gohugoio/hugoThemes/issues/682
-rw-r--r--layouts/_default/list.html5
-rw-r--r--layouts/partials/sidebar.html2
2 files changed, 4 insertions, 3 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 04bef9a..e93d33a 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -79,8 +79,9 @@
{{ end }}
{{ define "main" }}
<div class="container mt-4 mb-4 recent-posts">
- {{ $paginator := .Paginate (where (where .Pages "Type" "post") "Params.hidden" "!=" true) 10 }}
- {{ range (.Paginator 10).Pages }}
+ {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+ {{ $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" . }}
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index efbfdd4..70afc2e 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -14,7 +14,7 @@
{{ end }}
<h2 class="mt-4">Recent Posts</h2>
<nav class="nav flex-column">
- {{ range first 8 (where (where .Site.Pages "Section" "post") ".Params.hidden" "!=" true) }}
+ {{ range first 8 (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.hidden" "!=" true) }}
<a href="{{ .Permalink }}" class="nav-link">{{ .Title }}</a>
{{ end }}
</nav>