From c8d455cc3d4336702b4b9854ba686b584bf3f770 Mon Sep 17 00:00:00 2001 From: yingyu5658 Date: Sat, 24 Jan 2026 21:34:27 +0800 Subject: chore: recover the word count of category "往昔" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/shortcodes/word-count.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/word-count.html b/layouts/shortcodes/word-count.html index 142c42e..38dbe0e 100644 --- a/layouts/shortcodes/word-count.html +++ b/layouts/shortcodes/word-count.html @@ -1,9 +1,9 @@ {{ $scratch := newScratch }} {{ if eq (.Get 0) "posts" }} {{ range where site.RegularPages "Type" "in" (slice "posts" "jottings" "readings" "tech") }} {{ -if not (in .Params.categories "往昔") }} {{ $scratch.Add "wordcount" .WordCount +if not (in .Params.categories "!往昔!") }} {{ $scratch.Add "wordcount" .WordCount }} {{ end }} {{ end }} {{ else if eq (.Get 0) "all" }} {{ range where site.RegularPages "Type" "in" (slice "posts" "about" "newsgroup" "links" -"jottings" "readings" "tech") }} {{ if not (in .Params.categories "往昔") }} {{ +"jottings" "readings" "tech") }} {{ if not (in .Params.categories "!往昔") }} {{ $scratch.Add "wordcount" .WordCount }} {{ end }} {{ end }} {{ end }} {{ $count := $scratch.Get "wordcount" }} {{ if gt $count 0 }} {{ $count }} 字, {{/* 名著数据库(字数单位:汉字) */}} {{ $classics := slice (dict "name" "红楼梦" -- cgit v1.2.3