1
{{- /*
2
- Generated cover card — a locally-rendered, deterministic inline-SVG header
3
- visual for weekly articles. No third-party or hotlinked imagery.
2
+ Generated cover card — a locally-rendered, deterministic header visual for
3
+ weekly articles. No third-party or hotlinked imagery.
4
5
- Data-anchored: the bar field COUNT reflects the number of topic clusters
6
- tracked this week (from .Params.tags); the accessible name reports the real
7
- week, topic count, and repositories-featured figures. Per-bar height variation
8
- is a deterministic decorative motif (disclosed via aria-hidden) and is NOT a
9
- claim about per-topic magnitude — preserving the evidence-first editorial stance.
5
+ Data-anchored topic chart (issue #560): every bar IS a topic. Bars and topic
6
+ labels share one element, in the same order, so each topic maps 1:1 to its bar
7
+ (no more decorative bars that outnumber/misalign the topics). Bar height and the
8
+ printed number encode the topic's EDITORIAL-PROMINENCE RANK — the order the
9
+ weekly analysis emits its `tags`, lead topic first (1 = lead topic). This is a
10
+ real, disclosed ordering signal, not a fabricated per-topic magnitude, so it
11
+ preserves the evidence-first editorial stance. A caption legend states exactly
12
+ what the bars measure, and bars carry distinct tonal shading.
13
14
Params (dict):
15
page : the page context (required)
21
{{- $repos := $page.Params.repos_featured -}}
22
{{- $kicker := cond (ne $week "") (printf "Weekly signal · %s" $week) "Weekly signal" -}}
23
21
-{{- /* Deterministic seed from the week (or title) so each week renders a stable, distinct motif. */ -}}
22
-{{- $seedKey := cond (ne $week "") $week $page.Title -}}
23
-{{- $seed := (hash.FNV32a $seedKey) -}}
24
-
25
-{{- /* Number of bars = topic breadth this week, clamped to a sensible range for layout. */ -}}
26
-{{- $bars := $topicCount -}}
27
-{{- if lt $bars 6 }}{{ $bars = 6 }}{{ end -}}
28
-{{- if gt $bars 18 }}{{ $bars = 18 }}{{ end -}}
24
+{{- /* Show at most 12 topics as bars so labels stay legible; any remainder is
25
+ disclosed as a "+N more" note rather than silently dropped. */ -}}
26
+{{- $shown := $topics -}}
27
+{{- if gt $topicCount 12 }}{{ $shown = first 12 $topics }}{{ end -}}
28
+{{- $n := len $shown -}}
29
30
{{- /* Build an accessible summary from REAL data only. */ -}}
31
{{- $summaryParts := slice -}}
32
{{- if ne $week "" }}{{ $summaryParts = $summaryParts | append (printf "%s weekly report" $week) }}{{ else }}{{ $summaryParts = $summaryParts | append "Weekly report" }}{{ end -}}
33
-{{- if gt $topicCount 0 }}{{ $summaryParts = $summaryParts | append (printf "tracking %d topic clusters" $topicCount) }}{{ end -}}
33
+{{- if gt $topicCount 0 }}{{ $summaryParts = $summaryParts | append (printf "tracking %d topic clusters, ordered by editorial prominence" $topicCount) }}{{ end -}}
34
{{- if $repos }}{{ $summaryParts = $summaryParts | append (printf "across %s featured repositories" (lang.FormatNumber 0 $repos)) }}{{ end -}}
35
{{- $summary := printf "Generated cover: %s." (delimit $summaryParts ", ") -}}
36
37
<figure class="article-cover article-cover--generated" aria-label="{{ $summary }}">
38
<div class="article-cover__panel">
39
- <svg class="article-cover__motif" viewBox="0 0 1000 360" preserveAspectRatio="none" aria-hidden="true" focusable="false">
40
- {{- $slot := div 1000.0 $bars -}}
41
- {{- $barW := mul $slot 0.46 -}}
42
- {{- range $i := seq $bars -}}
43
- {{- $idx := sub $i 1 -}}
44
- {{- $h := add 56 (mod (mul (add $idx 1) (add $seed 131)) 268) -}}
45
- {{- $x := add (mul $idx $slot) (mul $slot 0.27) -}}
46
- {{- $y := sub 360 $h -}}
47
- <rect x="{{ $x }}" y="{{ $y }}" width="{{ $barW }}" height="{{ $h }}" rx="4" />
48
- {{- end -}}
49
- </svg>
39
<div class="article-cover__meta">
40
<p class="article-cover__kicker">{{ $kicker }}</p>
41
<p class="article-cover__brand">Claracle</p>
53
- {{- if gt $topicCount 0 }}
54
- {{- /* Topic titles are descriptive caption metadata, NOT controls. Render them
55
- as plain, non-interactive labels — no link, no button/pill affordance —
56
- so they never look clickable (operator ask, #328). */ -}}
57
- <ul class="article-cover__topics" aria-label="Topics tracked this week">
58
- {{- range first 6 $topics }}
59
- <li class="article-cover__topic">{{ . }}</li>
60
- {{- end }}
61
- {{- if gt $topicCount 6 }}
62
- <li class="article-cover__topic article-cover__topic--more">+{{ sub $topicCount 6 }} more</li>
63
- {{- end }}
64
- </ul>
65
- {{- end }}
42
</div>
43
+ {{- if gt $topicCount 0 }}
44
+ {{- /* Topic titles are descriptive caption metadata, NOT controls. Render them
45
+ as plain, non-interactive labels — no link, no button/pill affordance —
46
+ so they never look clickable (operator ask, #328). The ordered list
47
+ conveys rank to assistive tech; the printed number is the visible echo. */ -}}
48
+ <ol class="article-cover__topics" aria-label="Topic clusters tracked this week, ordered by editorial prominence (1 = lead topic)">
49
+ {{- range $i, $t := $shown }}
50
+ {{- $rank := add $i 1 -}}
51
+ {{- /* Height = rank: lead topic full height, descending to the last topic. */ -}}
52
+ {{- $hpct := printf "%.0f" (math.Round (div (mul (sub $n $i) 100.0) $n)) -}}
53
+ <li class="article-cover__topic" style="--bar-h:{{ $hpct }}%;--bar-i:{{ $i }};">
54
+ <span class="article-cover__bar-num" aria-hidden="true">{{ $rank }}</span>
55
+ <span class="article-cover__bar" aria-hidden="true"></span>
56
+ <span class="article-cover__topic-label" title="{{ $t }}">{{ $t }}</span>
57
+ </li>
58
+ {{- end }}
59
+ </ol>
60
+ <p class="article-cover__legend">
61
+ Each bar is one of this week's {{ $topicCount }} topic clusters, ordered by editorial prominence (1 = lead topic).
62
+ {{- if gt $topicCount $n }} Showing the top {{ $n }}; +{{ sub $topicCount $n }} more not charted.{{ end }}
63
+ </p>
64
+ {{- end }}
65
</div>
66
</figure>