From 7aa47fb7d3c3505d93a6c3c5f972e29ddd90ebef Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sat, 4 Jul 2020 17:33:29 +0200 Subject: [PATCH] use current section for listings --- layouts/_default/list.html | 3 ++- layouts/partials/sidebar.html | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 65a86e7..136b563 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -16,7 +16,8 @@
- {{ $paginator := .Paginate (where .Site.RegularPages "Section" "posts") }} + {{ $section := or .Section "posts" }} + {{ $paginator := .Paginate (where .Site.RegularPages "Section" $section) }} {{ range $paginator.Pages }} {{ partial "card.html" . }} {{ end }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index d57de4e..a1d3f81 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -33,11 +33,12 @@
-

{{i18n "recentArticles"}}

+

{{i18n "recentArticles"}}

    - {{ range first 3 (where .Site.RegularPages "Section" "posts") }} + {{ $section := or .Section "posts" }} + {{ range first 20 (where .Site.RegularPages "Section" $section) }}
  • {{ .Title }}