feat: correlation badges for Hugo templates (#80) (#110)
Add CSS-styled badges showing press correlation status next to repo entries. Three states: Press-correlated, Organic growth, and Hype risk. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Juan Manuel Servera committed
May 19, 2026 at 16:24 UTC
c8f704c6863d2471f2ee586eb54f9b3e28a1e9c2
4 files changed
+42
assets/css/badges.css
new
+24
@@ -0,0 +1,24 @@
1
+.badge {
2
+ display: inline-block;
3
+ padding: 2px 8px;
4
+ border-radius: 12px;
5
+ font-size: 0.75rem;
6
+ font-weight: 500;
7
+ margin-left: 8px;
8
+ vertical-align: middle;
9
+}
10
+.badge-press {
11
+ background-color: #e3f2fd;
12
+ color: #1565c0;
13
+ border: 1px solid #90caf9;
14
+}
15
+.badge-organic {
16
+ background-color: #e8f5e9;
17
+ color: #2e7d32;
18
+ border: 1px solid #a5d6a7;
19
+}
20
+.badge-hype {
21
+ background-color: #fff3e0;
22
+ color: #e65100;
23
+ border: 1px solid #ffcc80;
24
+}
layouts/partials/correlation-badge.html
new
+9
@@ -0,0 +1,9 @@
1
+{{ if .press_correlated }}
2
+ {{ if eq .hype_risk "high" }}
3
+ <span class="badge badge-hype" title="Press-driven hype, may be fading">⚠️ Hype risk</span>
4
+ {{ else }}
5
+ <span class="badge badge-press" title="Press-correlated growth">📰 Press-correlated</span>
6
+ {{ end }}
7
+{{ else if .organic }}
8
+ <span class="badge badge-organic" title="Organic community growth">🌱 Organic growth</span>
9
+{{ end }}
layouts/partials/extend_head.html
+3
@@ -2,3 +2,6 @@
2
<link rel="stylesheet" href="{{ `pagefind/pagefind-ui.css` | absURL }}">
3
<script src="{{ `pagefind/pagefind-ui.js` | absURL }}" defer></script>
4
{{- end -}}
5
+{{- with resources.Get "css/badges.css" }}
6
+<style>{{ .Content | safeCSS }}</style>
7
+{{- end -}}
layouts/weekly/single.html
+6
@@ -19,6 +19,12 @@
19
20
{{ partial "report-metrics.html" . }}
21
22
+ {{- with .Params.correlation }}
23
+ <div class="correlation-badges">
24
+ {{ partial "correlation-badge.html" . }}
25
+ </div>
26
+ {{- end }}
27
+
28
{{ partial "report-shortcuts.html" . }}
29
30
<div class="post-content md-content">