From e2274c6b35d56e9cc50b7d67c96e8dbbe073182d Mon Sep 17 00:00:00 2001 From: Guansong Wang Date: Sat, 2 Mar 2019 05:01:16 +0800 Subject: [PATCH] fix: "See More" link in Pages widget not appearing After the "Offset and Limit" section, `$query` would have length of `$items_count`, which makes `$count` always equal to `$items_count`. The later "if" condition for adding the "see all posts" link will never be met. The fix is to record the length of `$query` into `$count` before any offset and limit. See #963 --- layouts/partials/widgets/pages.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/widgets/pages.html b/layouts/partials/widgets/pages.html index 7a32df79..71b6a2e1 100644 --- a/layouts/partials/widgets/pages.html +++ b/layouts/partials/widgets/pages.html @@ -40,6 +40,8 @@ {{ $query = where $query "Date" "<" now }} {{ end }} +{{ $count := len $query }} + {{/* Sort */}} {{ $sort_by := "Date" }} {{ $query = sort $query $sort_by $items_sort }} @@ -51,8 +53,6 @@ {{ $query = first $items_count $query }} {{ end }} -{{ $count := len $query }} - {{/* Localisation */}} {{ $i18n := "" }} {{ if eq $items_type "post" }}