main
html 33 lines 1.43 KB
Raw
1 {{- $page := . -}}
2 {{- $hasWeek := and (isset $page.Params "week") (ne (index $page.Params "week") "") -}}
3 {{- $hasRepos := isset $page.Params "repos_featured" -}}
4 {{- $hasStars := isset $page.Params "stars_tracked" -}}
5 {{- $hasTopRepo := and (isset $page.Params "top_repo") (ne (index $page.Params "top_repo") "") -}}
6 {{- if or $hasWeek $hasRepos $hasStars $hasTopRepo -}}
7 <div class="report-metrics" aria-label="Report metrics">
8 {{- if $hasWeek -}}
9 <div class="metric-card">
10 <span class="metric-label">Week</span>
11 <strong class="metric-value">{{ index $page.Params "week" }}</strong>
12 </div>
13 {{- end -}}
14 {{- if $hasRepos -}}
15 <div class="metric-card">
16 <span class="metric-label">Repos featured</span>
17 <strong class="metric-value">{{ lang.FormatNumber 0 (index $page.Params "repos_featured") }}</strong>
18 </div>
19 {{- end -}}
20 {{- if $hasStars -}}
21 <div class="metric-card">
22 <span class="metric-label">Stars tracked</span>
23 <strong class="metric-value">{{ lang.FormatNumber 0 (index $page.Params "stars_tracked") }}</strong>
24 </div>
25 {{- end -}}
26 {{- if $hasTopRepo -}}
27 <div class="metric-card metric-card-wide">
28 <span class="metric-label">Top repo</span>
29 <strong class="metric-value"><a href="https://github.com/{{ index $page.Params "top_repo" }}" aria-label="Open GitHub repository {{ index $page.Params "top_repo" }}">{{ index $page.Params "top_repo" }}</a></strong>
30 </div>
31 {{- end -}}
32 </div>
33 {{- end -}}