main
html 71 lines 2.54 KB
Raw
1 {{- define "main" -}}
2 {{- $tagTerms := site.Taxonomies.tags.ByCount -}}
3 {{- $categoryTerms := site.Taxonomies.categories.Alphabetical -}}
4 <header class="page-header">
5 {{- partial "breadcrumbs.html" . }}
6 <h1>{{ .Title }}</h1>
7 <div class="post-description">{{ .Description | default "Browse weekly issues by topic area, then jump across weekly, monthly, and yearly report categories." }}</div>
8 </header>
9
10 <section aria-labelledby="topics-directory-heading">
11 <div class="section-heading-row">
12 <div>
13 <div class="section-topline">Browse by theme</div>
14 <h2 id="topics-directory-heading">Active topics</h2>
15 </div>
16 <a href="{{ `categories/` | absLangURL }}">Browse categories</a>
17 </div>
18
19 {{- if $tagTerms }}
20 <div class="taxonomy-grid">
21 {{- range $tagTerms }}
22 {{- $term := .Name -}}
23 {{- $count := .Count -}}
24 {{- with site.GetPage (printf "/tags/%s" $term) }}
25 <article class="home-report-card taxonomy-card">
26 <h3><a href="{{ .RelPermalink }}">{{ $term | humanize }}</a></h3>
27 <p>Browse {{ $count }} weekly issue{{ if ne $count 1 }}s{{ end }} touching {{ $term | humanize | lower }}.</p>
28 <div class="home-report-meta">
29 <span>{{ $count }} issue{{ if ne $count 1 }}s{{ end }}</span>
30 <span>Topic</span>
31 </div>
32 </article>
33 {{- end }}
34 {{- end }}
35 </div>
36 {{- else }}
37 <section class="home-empty-state">
38 <h2>No topics published yet</h2>
39 <p>Topic cards will appear here as soon as weekly issues ship with topic tags.</p>
40 </section>
41 {{- end }}
42 </section>
43
44 {{- if $categoryTerms }}
45 <section aria-labelledby="categories-directory-heading">
46 <div class="section-heading-row">
47 <div>
48 <div class="section-topline">Browse by cadence</div>
49 <h2 id="categories-directory-heading">Report categories</h2>
50 </div>
51 <a href="{{ `categories/` | absLangURL }}">Open categories page</a>
52 </div>
53 <div class="taxonomy-grid">
54 {{- range $categoryTerms }}
55 {{- $term := .Name -}}
56 {{- $count := .Count -}}
57 {{- with site.GetPage (printf "/categories/%s" $term) }}
58 <article class="home-report-card taxonomy-card">
59 <h3><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h3>
60 <p>{{ .Params.summary | default (printf "Browse %d report%s filed under %s." $count (cond (eq $count 1) "" "s") ($term | humanize | lower)) }}</p>
61 <div class="home-report-meta">
62 <span>{{ $count }} report{{ if ne $count 1 }}s{{ end }}</span>
63 <span>Category</span>
64 </div>
65 </article>
66 {{- end }}
67 {{- end }}
68 </div>
69 </section>
70 {{- end }}
71 {{- end -}}