From fd3a76bbf07b8e6d10f00a6486454c5a6d3e993a Mon Sep 17 00:00:00 2001 From: 4evour Date: Mon, 3 Aug 2026 18:19:28 +0800 Subject: [PATCH] fix: show contributor count on contributors page --- layouts/docs/list.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/layouts/docs/list.html b/layouts/docs/list.html index ce1ba6a..4143f60 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -1,6 +1,9 @@ {{ define "main" }} {{ $summary := partial "goclub/lead-summary.html" . }} {{ $content := partial "goclub/stripped-content.html" . }} + {{ $filePath := replace .File.Path "\\" "/" }} + {{ $isContributors := eq $filePath "docs/contributors/_index.md" }} + {{ $contributors := hugo.Data.contributors }}
{{ partial "docs/title" . }}
@@ -8,7 +11,11 @@
{{ . }}
{{ end }}
- 共 {{ len (where .Pages "Params.bookHidden" "ne" true) }} 篇 + {{ if $isContributors }} + 共 {{ len $contributors }} 位贡献者 + {{ else }} + 共 {{ len (where .Pages "Params.bookHidden" "ne" true) }} 篇 + {{ end }}
@@ -16,8 +23,7 @@ {{ partial "goclub-section-cards.html" . }} - {{ if eq .File.Path "docs/contributors/_index.md" }} - {{ $contributors := hugo.Data.contributors }} + {{ if $isContributors }}
{{ if $contributors }}