Skip to content

Commit 4a20c5d

Browse files
authored
Update Counters (#304)
This pull request updates the statistics shown on the homepage to provide more accurate and dynamic counts for expansions and expert authors. **Homepage statistics improvements:** * Changed the expansions count to display only the number of sections of type `"guide"` instead of all site sections, making the statistic more relevant. * Updated the expert authors count to dynamically calculate the number of unique contributors based on their GitHub usernames or names, instead of displaying a hardcoded value. <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/ScrumGuides/ScrumGuide-ExpansionPack/304) <!-- Reviewable:end -->
2 parents 9c58051 + fd525c2 commit 4a20c5d

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

site/layouts/index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,22 @@ <h2 class="display-6 fw-bold mb-4">{{ i18n "open_source_title" | default "Open S
3434
<div class="row g-4 mb-5 justify-content-center">
3535
<div class="col-4 col-md-3">
3636
<div class="text-center">
37-
<div class="display-6 fw-bold text-primary mb-2">{{ len .Site.Sections }}+</div>
37+
<div class="display-6 fw-bold text-primary mb-2">{{ len (where .Site.Sections "Type" "guide") }}+</div>
3838
<div class="small text-muted">{{ i18n "expansions" | default "Expansions" }}</div>
3939
</div>
4040
</div>
4141
<div class="col-4 col-md-3">
4242
<div class="text-center">
43-
<div class="display-6 fw-bold text-primary mb-2">3</div>
43+
{{- $uniqueContributors := slice }}
44+
{{- range $key, $value := .Site.Data.contributions }}
45+
{{- range $value }}
46+
{{- $identifier := .githubUsername | default .name }}
47+
{{- if not (in $uniqueContributors $identifier) }}
48+
{{- $uniqueContributors = $uniqueContributors | append $identifier }}
49+
{{- end }}
50+
{{- end }}
51+
{{- end }}
52+
<div class="display-6 fw-bold text-primary mb-2">{{ len $uniqueContributors }}</div>
4453
<div class="small text-muted">{{ i18n "expert_authors" | default "Expert Authors" }}</div>
4554
</div>
4655
</div>

0 commit comments

Comments
 (0)