From 04a283789b4dc83256ba56e3537b1fdefa685a8f Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 27 Nov 2025 23:44:05 +0800 Subject: refactor: count all pages, not just post Former-commit-id: d8216497af34e73bb2ab5708c8eb6079c1cfe97f --- layouts/_shortcodes/postcount.html | 2 +- layouts/_shortcodes/wordcount.html | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/_shortcodes/postcount.html b/layouts/_shortcodes/postcount.html index 68da6893..84c6378f 100644 --- a/layouts/_shortcodes/postcount.html +++ b/layouts/_shortcodes/postcount.html @@ -1 +1 @@ -{{ len (where .Site.RegularPages "Section" "posts") }} +{{ len (where .Site.RegularPages "Section" "!=" "") }} diff --git a/layouts/_shortcodes/wordcount.html b/layouts/_shortcodes/wordcount.html index 3b302b82..b2f5b414 100644 --- a/layouts/_shortcodes/wordcount.html +++ b/layouts/_shortcodes/wordcount.html @@ -1,5 +1,7 @@ {{ $total := 0 }} -{{ range where .Site.RegularPages "Section" "posts" }} + +{{ range where .Site.RegularPages "Section" "!=" "" }} {{ $total = add $total .WordCount }} {{ end }} + {{ $total }} -- cgit v1.2.3