jekyll-theme-zer0 1.31.3 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +131 -0
  3. data/_data/backlog.yml +97 -28
  4. data/_data/features.yml +164 -15
  5. data/_data/navigation/admin.yml +26 -8
  6. data/_data/navigation/docs.yml +2 -8
  7. data/_data/theme-manifest.yml +63 -47
  8. data/_data/ui-text.yml +9 -0
  9. data/_includes/README.md +2 -1
  10. data/_includes/components/ai-chat.html +2 -2
  11. data/_includes/components/author-bio.html +3 -1
  12. data/_includes/components/author-card.html +9 -9
  13. data/_includes/components/author-eeat.html +13 -3
  14. data/_includes/components/collection-manager.html +2 -2
  15. data/_includes/components/component-showcase.html +7 -7
  16. data/_includes/components/cookie-consent-needed.html +37 -0
  17. data/_includes/components/cookie-consent.html +15 -5
  18. data/_includes/components/page-feedback.html +9 -5
  19. data/_includes/components/post-card.html +2 -2
  20. data/_includes/components/theme-customizer.html +1 -1
  21. data/_includes/content/comments.html +46 -0
  22. data/_includes/content/giscus.html +22 -13
  23. data/_includes/content/intro.html +17 -1
  24. data/_includes/content/jsonld-software.html +4 -9
  25. data/_includes/core/footer.html +36 -14
  26. data/_includes/navigation/admin-nav.html +110 -63
  27. data/_includes/navigation/section-sidebar.html +20 -20
  28. data/_includes/navigation/sidebar-config.html +17 -8
  29. data/_includes/navigation/sidebar-right.html +16 -2
  30. data/_layouts/README.md +1 -1
  31. data/_layouts/admin.html +49 -20
  32. data/_layouts/article.html +10 -10
  33. data/_layouts/book-story.html +3 -7
  34. data/_layouts/default.html +55 -1
  35. data/_layouts/news.html +8 -7
  36. data/_layouts/note.html +2 -6
  37. data/_layouts/notebook.html +2 -6
  38. data/_layouts/recipe.html +3 -7
  39. data/_layouts/root.html +7 -4
  40. data/_layouts/section.html +43 -42
  41. data/_sass/components/_page-feedback.scss +1 -1
  42. data/_sass/components/_ui-enhancements.scss +22 -0
  43. data/_sass/core/_nav-tree.scss +10 -2
  44. data/_sass/core/_navbar.scss +19 -5
  45. data/_sass/core/_obsidian.scss +19 -3
  46. data/_sass/core/_sidebar-categories.scss +4 -2
  47. data/_sass/core/_sidebar-extras.scss +3 -2
  48. data/_sass/layouts/_admin.scss +60 -0
  49. data/_sass/layouts/_navbar-extras.scss +7 -2
  50. data/_sass/theme/_skins.scss +124 -32
  51. data/_sass/tokens/_color.scss +3 -0
  52. data/_sass/tokens/_layers.scss +12 -5
  53. data/assets/css/main.scss +1 -0
  54. data/assets/js/code-copy.js +30 -2
  55. data/assets/js/setup-wizard.js +2 -2
  56. data/assets/js/ui-enhancements.js +46 -0
  57. data/scripts/ai/README.md +1 -1
  58. data/scripts/bin/audit-consumer +155 -8
  59. data/scripts/bin/manifest +27 -8
  60. data/scripts/bin/validate +3 -2
  61. data/scripts/lib/audit.sh +156 -0
  62. data/scripts/validate-features.rb +20 -2
  63. metadata +5 -2
@@ -4,6 +4,21 @@
4
4
  // Maps each data-theme-skin to Bootstrap + --zer0-color-* tokens so skin
5
5
  // previews affect buttons, links, borders, cards, nav, and alerts — not just
6
6
  // SVG backgrounds. Color values mirror _data/theme_backgrounds.yml.
7
+ //
8
+ // Contrast contract (WCAG 2.1 SC 1.4.3: 4.5:1 for text; #410 / T-042):
9
+ // - $brand is a SURFACE colour. Text never uses it raw: the light brands
10
+ // (air, aqua, mint, plum, sunrise) sit at 2.3-2.7:1 on white and the dark
11
+ // ones (dirt, neon) at 2.4-2.6:1 on #212529.
12
+ // - Ordinary brand text (.text-primary, .link-primary, .page-link, outline
13
+ // buttons) uses the link colour of the current mode.
14
+ // - Selected and current states (active tab, current crumb, active navbar
15
+ // link) and text on a brand tint (.alert-primary) use the stronger
16
+ // link-hover shade: darker than the link in light mode, lighter in dark.
17
+ // - Text ON a brand fill (.btn-primary, .badge.bg-primary, .text-bg-primary,
18
+ // active list and page items, the current dropdown item) uses $on-brand,
19
+ // exposed as --zer0-color-on-primary.
20
+ // Each skin below carries its measured ratios (Python, WCAG 2.x relative
21
+ // luminance; button states use the same 85% / 75% color-mix as the CSS).
7
22
  // ==========================================================================
8
23
 
9
24
  // $link-light / $link-light-hover — link colors for light mode; should reach
@@ -11,22 +26,32 @@
11
26
  // $link-dark / $link-dark-hover — link colors for dark mode; should reach
12
27
  // WCAG AA (≥4.5:1) against Bootstrap's dark body background (#212529).
13
28
  // Falls back to $brand (light) / $accent (dark) when not supplied.
29
+ // $on-brand — text on a $brand fill. Must reach 4.5:1 on $brand AND on the
30
+ // .btn-primary hover/active mixes. White only works on the dark brands;
31
+ // the light ones pass #000 (Bootstrap's color-contrast() dark choice).
32
+ // $brand-shade — what the .btn-primary hover (85%) and active (75%) states mix
33
+ // toward. Falls back to $accent; a skin whose light accent would pull the
34
+ // mix under 4.5:1 against $on-brand passes a darker shade instead.
14
35
  @mixin zer0-skin-palette(
15
36
  $brand, $brand-rgb, $accent, $accent-rgb: null,
16
37
  $link-light: null, // WCAG-AA color on white (light mode)
17
38
  $link-light-hover: null, // Hover variant in light mode
18
39
  $link-dark: null, // WCAG-AA color on dark bg (dark mode)
19
- $link-dark-hover: null // Hover variant in dark mode
40
+ $link-dark-hover: null, // Hover variant in dark mode
41
+ $on-brand: #fff, // Text on a $brand fill (buttons, badges, active items)
42
+ $brand-shade: null // .btn-primary hover/active mix target; defaults to $accent
20
43
  ) {
21
44
  // Resolve: fall back to $brand / $accent when params are omitted
22
45
  $_ll: if($link-light != null, $link-light, $brand);
23
46
  $_llh: if($link-light-hover != null, $link-light-hover, $_ll);
24
47
  $_ld: if($link-dark != null, $link-dark, $accent);
25
48
  $_ldh: if($link-dark-hover != null, $link-dark-hover, $_ld);
49
+ $_shade: if($brand-shade != null, $brand-shade, $accent);
26
50
 
27
51
  --zer0-color-primary: #{$brand};
28
52
  --zer0-color-primary-rgb: #{$brand-rgb};
29
53
  --zer0-color-accent: #{$accent};
54
+ --zer0-color-on-primary: #{$on-brand};
30
55
  --bs-primary: #{$brand};
31
56
  --bs-primary-rgb: #{$brand-rgb};
32
57
 
@@ -44,32 +69,50 @@
44
69
  --zer0-color-bg-muted: color-mix(in srgb, #{$brand} 6%, var(--bs-secondary-bg, var(--bs-body-bg)));
45
70
 
46
71
  // Bootstrap component wiring
72
+ // Bootstrap leaves --bs-btn-color white; on the light brands that was
73
+ // 2.2-2.8:1 (air 2.53:1 at rest), so every state takes $on-brand.
47
74
  .btn-primary {
75
+ --bs-btn-color: #{$on-brand};
48
76
  --bs-btn-bg: #{$brand};
49
77
  --bs-btn-border-color: #{$brand};
50
- --bs-btn-hover-bg: color-mix(in srgb, #{$brand} 85%, #{$accent});
51
- --bs-btn-hover-border-color: color-mix(in srgb, #{$brand} 85%, #{$accent});
52
- --bs-btn-active-bg: color-mix(in srgb, #{$brand} 75%, #{$accent});
53
- --bs-btn-active-border-color: color-mix(in srgb, #{$brand} 75%, #{$accent});
78
+ --bs-btn-hover-color: #{$on-brand};
79
+ --bs-btn-hover-bg: color-mix(in srgb, #{$brand} 85%, #{$_shade});
80
+ --bs-btn-hover-border-color: color-mix(in srgb, #{$brand} 85%, #{$_shade});
81
+ --bs-btn-active-color: #{$on-brand};
82
+ --bs-btn-active-bg: color-mix(in srgb, #{$brand} 75%, #{$_shade});
83
+ --bs-btn-active-border-color: color-mix(in srgb, #{$brand} 75%, #{$_shade});
54
84
  }
55
85
 
56
86
  .btn-outline-primary {
57
- --bs-btn-color: #{$brand};
87
+ --bs-btn-color: var(--bs-link-color);
58
88
  --bs-btn-border-color: #{$brand};
89
+ --bs-btn-hover-color: #{$on-brand};
59
90
  --bs-btn-hover-bg: #{$brand};
60
91
  --bs-btn-hover-border-color: #{$brand};
92
+ --bs-btn-active-color: #{$on-brand};
61
93
  --bs-btn-active-bg: #{$brand};
62
94
  --bs-btn-active-border-color: #{$brand};
63
95
  }
64
96
 
97
+ // Brand-filled badges: .bg-primary paints the fill, so the badge text has to
98
+ // follow it (Bootstrap's --bs-badge-color is a fixed #fff). .text-bg-primary
99
+ // sets its colour with !important, so the override needs one too.
100
+ .badge.bg-primary {
101
+ --bs-badge-color: #{$on-brand};
102
+ }
103
+
104
+ .text-bg-primary {
105
+ color: #{$on-brand} !important;
106
+ }
107
+
65
108
  .alert-primary {
66
- --bs-alert-color: #{$brand};
109
+ --bs-alert-color: var(--bs-link-hover-color);
67
110
  --bs-alert-bg: rgba(#{$brand-rgb}, 0.12);
68
111
  --bs-alert-border-color: rgba(#{$brand-rgb}, 0.35);
69
112
  }
70
113
 
71
114
  .nav-tabs .nav-link.active {
72
- color: #{$brand};
115
+ color: var(--bs-link-hover-color);
73
116
  border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-body-bg);
74
117
  }
75
118
 
@@ -86,6 +129,18 @@
86
129
  color: var(--bs-link-color);
87
130
  }
88
131
 
132
+ // Current and active links sit on a tint: the sidebar trees mark the current
133
+ // page (.active, aria-current) on --bs-primary-bg-subtle, the TOC scroll-spy
134
+ // marks its section on a brand tint. The plain link colour falls under 4.5:1
135
+ // there (mint 3.68:1, sunrise 4.20:1, aqua 4.38:1 on #cfe2ff), so they take
136
+ // the stronger link-hover shade. The extra .active / [aria-current] outranks
137
+ // the rule above; brand-filled .list-group-item / .page-link are left to
138
+ // their own rules below.
139
+ a.active:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge):not(.list-group-item):not(.page-link),
140
+ a[aria-current="page"]:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge) {
141
+ color: var(--bs-link-hover-color);
142
+ }
143
+
89
144
  a:not(.btn):not(.badge):hover {
90
145
  color: var(--bs-link-hover-color);
91
146
  }
@@ -96,8 +151,10 @@
96
151
  border-color: var(--zer0-color-border);
97
152
  }
98
153
 
99
- // List group active state
154
+ // List group active state. !important: an <a class="list-group-item"> is
155
+ // otherwise repainted by the link rules above (specificity 0,5,1).
100
156
  .list-group-item.active {
157
+ color: #{$on-brand} !important;
101
158
  background-color: #{$brand};
102
159
  border-color: #{$brand};
103
160
  }
@@ -121,16 +178,19 @@
121
178
 
122
179
  // Pagination & breadcrumbs
123
180
  .page-link {
124
- color: #{$brand};
181
+ color: var(--bs-link-color);
125
182
  }
126
183
 
127
- .page-item.active .page-link {
184
+ // !important for the same reason as .list-group-item.active above.
185
+ .page-item.active .page-link,
186
+ .page-link.active {
187
+ color: #{$on-brand} !important;
128
188
  background-color: #{$brand};
129
189
  border-color: #{$brand};
130
190
  }
131
191
 
132
192
  .breadcrumb-item.active {
133
- color: #{$brand};
193
+ color: var(--bs-link-hover-color);
134
194
  }
135
195
 
136
196
  // Progress
@@ -147,15 +207,16 @@
147
207
  border-color: rgba(var(--bs-primary-rgb), 0.4);
148
208
  }
149
209
 
150
- // Navbar snippet / active nav links
210
+ // Navbar snippet / active nav links (the navbar is --bs-tertiary-bg)
151
211
  .navbar .nav-link.active,
152
212
  .navbar .nav-link.show {
153
- color: #{$brand};
213
+ color: var(--bs-link-hover-color);
154
214
  }
155
215
 
156
- // Text & border utilities tied to primary
216
+ // Text & border utilities tied to primary. Text takes the link colour of
217
+ // the current mode; the border keeps the brand (non-text, decorative).
157
218
  .text-primary {
158
- color: #{$brand} !important;
219
+ color: var(--bs-link-color) !important;
159
220
  }
160
221
 
161
222
  .border-primary {
@@ -163,7 +224,7 @@
163
224
  }
164
225
 
165
226
  .link-primary {
166
- color: #{$brand} !important;
227
+ color: var(--bs-link-color) !important;
167
228
  }
168
229
 
169
230
  // Dark-mode link overrides — switch to lighter tones for contrast on dark bg
@@ -175,86 +236,117 @@
175
236
  }
176
237
  }
177
238
 
239
+ // Measured ratios (WCAG 2.x relative luminance; 4.5:1 is AA for text).
240
+ // "navbar" is --bs-tertiary-bg (#f8f9fa light, #2b3035 dark); "card" is the
241
+ // 10% brand tint on .card; "tints" is the worst of --bs-primary-bg-subtle and
242
+ // the 10-15% brand tints that active states and .alert-primary sit on;
243
+ // "on-brand" is .btn-primary at rest, hover (85% mix) and active (75% mix).
244
+
178
245
  // air — steel blue
179
- // Light: #1e5fa8 (≈6.5:1 on white) / Dark: #b8d4e3 (≈8.5:1 on #212529)
246
+ // light link #1e5fa8 6.45 white · 6.12 navbar · 5.94 card; hover #154a87 ≥ 6.77 on tints
247
+ // dark link #b8d4e3 9.96 body · 8.60 navbar · 8.40 card; hover #d6eaf4 ≥ 9.56 on tints
248
+ // on-brand #000 8.31 · 8.97 · 9.44 (white was 2.53 · 2.34 · 2.23)
180
249
  [data-theme-skin="air"] {
181
250
  @include zer0-skin-palette(
182
251
  #6fa8dc, "111, 168, 220", #b8d4e3,
183
252
  $link-light: #1e5fa8,
184
253
  $link-light-hover: #154a87,
185
254
  $link-dark: #b8d4e3,
186
- $link-dark-hover: #d6eaf4
255
+ $link-dark-hover: #d6eaf4,
256
+ $on-brand: #000
187
257
  );
188
258
  }
189
259
 
190
260
  // aqua — cyan/teal
191
- // Light: #006d99 (≈5.5:1 on white) / Dark: #67d7ec (≈8.0:1 on #212529)
261
+ // light link #006d99 5.76 white · 5.46 navbar · 5.24 card; hover #005577 ≥ 6.23 on tints
262
+ // dark link #67d7ec 9.19 body · 7.93 navbar · 7.84 card; hover #9ae8f5 ≥ 8.73 on tints
263
+ // on-brand #000 8.52 · 9.14 · 9.58 (white was 2.46 · 2.30 · 2.19)
192
264
  [data-theme-skin="aqua"] {
193
265
  @include zer0-skin-palette(
194
266
  #00b4d8, "0, 180, 216", #90e0ef,
195
267
  $link-light: #006d99,
196
268
  $link-light-hover: #005577,
197
269
  $link-dark: #67d7ec,
198
- $link-dark-hover: #9ae8f5
270
+ $link-dark-hover: #9ae8f5,
271
+ $on-brand: #000
199
272
  );
200
273
  }
201
274
 
202
275
  // dirt — earthy gold/brown
203
- // Light: #7a5a10 (≈5.0:1 on white) / Dark: #e0b882 (≈7.0:1 on #212529)
276
+ // light link #7a5a10 6.37 white · 6.04 navbar · 5.59 card; hover #5c430c ≥ 7.06 on tints
277
+ // dark link #e0b882 8.34 body · 7.20 navbar · 7.61 card; hover #f0cea0 ≥ 8.96 on tints
278
+ // on-brand #fff 5.09 · 5.55 · 5.88 — hover/active mix toward the dark
279
+ // link-hover brown: toward the #d4a574 accent they were 4.44 · 4.07, and
280
+ // #000 is only 4.13 on the brand itself.
204
281
  [data-theme-skin="dirt"] {
205
282
  @include zer0-skin-palette(
206
283
  #8b6914, "139, 105, 20", #d4a574,
207
284
  $link-light: #7a5a10,
208
285
  $link-light-hover: #5c430c,
209
286
  $link-dark: #e0b882,
210
- $link-dark-hover: #f0cea0
287
+ $link-dark-hover: #f0cea0,
288
+ $on-brand: #fff,
289
+ $brand-shade: #5c430c
211
290
  );
212
291
  }
213
292
 
214
293
  // neon — electric purple/blue
215
- // Light: #5e22cc (≈5.5:1 on white) / Dark: #8ab4ff (≈6.0:1 on #212529)
294
+ // light link #5e22cc 8.15 white · 7.73 navbar · 7.03 card; hover #4a1aa3 ≥ 8.12 on tints
295
+ // dark link #8ab4ff 7.38 body · 6.38 navbar · 6.90 card; hover #b0ccff ≥ 8.53 on tints
296
+ // on-brand #fff 5.61 · 5.44 · 5.27
216
297
  [data-theme-skin="neon"] {
217
298
  @include zer0-skin-palette(
218
299
  #8338ec, "131, 56, 236", #3a86ff, "58, 134, 255",
219
300
  $link-light: #5e22cc,
220
301
  $link-light-hover: #4a1aa3,
221
302
  $link-dark: #8ab4ff,
222
- $link-dark-hover: #b0ccff
303
+ $link-dark-hover: #b0ccff,
304
+ $on-brand: #fff
223
305
  );
224
306
  }
225
307
 
226
308
  // mint — forest green
227
- // Light: #2d8059 (≈5.5:1 on white) / Dark: #80cfa8 (≈7.5:1 on #212529)
309
+ // light link #287652 5.52 white · 5.24 navbar · 5.08 card; hover #1f5a3b ≥ 6.18 on tints
310
+ // (was #2d8059: 4.83 white, 4.45 on the card tint)
311
+ // dark link #80cfa8 8.38 body · 7.23 navbar · 7.07 card; hover #a8e6c4 ≥ 8.35 on tints
312
+ // on-brand #000 8.49 · 9.00 · 9.35 (white was 2.47 · 2.33 · 2.24)
228
313
  [data-theme-skin="mint"] {
229
314
  @include zer0-skin-palette(
230
315
  #52b788, "82, 183, 136", #95d5b2,
231
- $link-light: #2d8059,
316
+ $link-light: #287652,
232
317
  $link-light-hover: #1f5a3b,
233
318
  $link-dark: #80cfa8,
234
- $link-dark-hover: #a8e6c4
319
+ $link-dark-hover: #a8e6c4,
320
+ $on-brand: #000
235
321
  );
236
322
  }
237
323
 
238
324
  // plum — deep violet
239
- // Light: #6b2477 (≈8.0:1 on white) / Dark: #d4a0f5 (≈7.0:1 on #212529)
325
+ // light link #6b2477 9.80 white · 9.29 navbar · 8.95 card; hover #4e1958 ≥ 9.96 on tints
326
+ // dark link #d4a0f5 7.45 body · 6.43 navbar · 6.37 card; hover #e8c8ff ≥ 8.15 on tints
327
+ // on-brand #000 7.81 · 6.75 · 6.10 (white was 2.69 · 3.11 · 3.44)
240
328
  [data-theme-skin="plum"] {
241
329
  @include zer0-skin-palette(
242
330
  #c77dff, "199, 125, 255", #812f85,
243
331
  $link-light: #6b2477,
244
332
  $link-light-hover: #4e1958,
245
333
  $link-dark: #d4a0f5,
246
- $link-dark-hover: #e8c8ff
334
+ $link-dark-hover: #e8c8ff,
335
+ $on-brand: #000
247
336
  );
248
337
  }
249
338
 
250
339
  // sunrise — warm terracotta/orange
251
- // Light: #b54418 (≈5.5:1 on white) / Dark: #ffa87a (≈7.0:1 on #212529)
340
+ // light link #b54418 5.52 white · 5.24 navbar · 4.98 card; hover #8f3512 ≥ 5.95 on tints
341
+ // dark link #ffa87a 8.18 body · 7.06 navbar · 7.15 card; hover #ffd0b0 ≥ 8.85 on tints
342
+ // on-brand #000 7.41 · 8.00 · 8.46 (white was 2.84 · 2.62 · 2.48)
252
343
  [data-theme-skin="sunrise"] {
253
344
  @include zer0-skin-palette(
254
345
  #ff6b35, "255, 107, 53", #f7c59f,
255
346
  $link-light: #b54418,
256
347
  $link-light-hover: #8f3512,
257
348
  $link-dark: #ffa87a,
258
- $link-dark-hover: #ffd0b0
349
+ $link-dark-hover: #ffd0b0,
350
+ $on-brand: #000
259
351
  );
260
352
  }
@@ -20,6 +20,9 @@
20
20
  --zer0-color-primary-rgb: var(--bs-primary-rgb, 0, 123, 255);
21
21
  --zer0-color-secondary: var(--bs-secondary, #6c757d);
22
22
  --zer0-color-accent: var(--bd-accent, #ffe484);
23
+ // Text on a primary fill. White passes on Bootstrap's #0d6efd (4.50:1); the
24
+ // palette skins in _sass/theme/_skins.scss set #000 on their light brands.
25
+ --zer0-color-on-primary: #fff;
23
26
 
24
27
  // Semantic state ---------------------------------------------------------
25
28
  --zer0-color-success: var(--bs-success, #28a745);
@@ -17,11 +17,18 @@
17
17
  --zer0-layer-backdrop: 1040;
18
18
 
19
19
  // Floating action buttons (stack bottom-to-top) --------------------------
20
- --zer0-layer-fab-back-to-top: 1050;
21
- --zer0-layer-fab-feedback: 1051; // page-feedback FAB (bottom-left)
22
- --zer0-layer-fab-chat: 1052;
23
- --zer0-layer-fab-toc: 1055;
24
- --zer0-layer-fab-local-graph: 1060;
20
+ // The whole band sits between the header and the backdrop, so an open
21
+ // overlay always covers every FAB: header 1030 < FABs < backdrop 1040 <
22
+ // offcanvas 1045 < modal 1055. FABs never overlap the fixed header, so
23
+ // nothing else had to move. Putting the band above the overlays (the old
24
+ // 1050-1060) left the TOC and local-graph FABs painted over — and still
25
+ // hit-testable on top of — the open search modal, nav menu and TOC panel
26
+ // (issue #572). Keep every FAB in 1031-1039.
27
+ --zer0-layer-fab-back-to-top: 1031;
28
+ --zer0-layer-fab-feedback: 1032; // page-feedback FAB (bottom-left)
29
+ --zer0-layer-fab-chat: 1033;
30
+ --zer0-layer-fab-toc: 1034;
31
+ --zer0-layer-fab-local-graph: 1035;
25
32
 
26
33
  // Overlay surfaces -------------------------------------------------------
27
34
  --zer0-layer-offcanvas: 1045;
data/assets/css/main.scss CHANGED
@@ -50,6 +50,7 @@
50
50
  @import "layouts/landing";
51
51
  @import "layouts/section";
52
52
  @import "layouts/navbar-extras";
53
+ @import "layouts/admin";
53
54
 
54
55
  // 7. Bootstrap Styles
55
56
  // @import "bootstrap.scss";
@@ -152,10 +152,33 @@ document.addEventListener('DOMContentLoaded', function () {
152
152
  if (preElement) preElements.add(preElement);
153
153
  });
154
154
 
155
+ // Every region needs a name of its own (axe landmark-unique, #593): two
156
+ // blocks both called "bash code block" are one landmark listed twice in a
157
+ // screen reader's region list, with nothing to tell them apart. So count the
158
+ // names first, and number a name's blocks ("bash code block 2") only when
159
+ // the page has more than one of it.
160
+ function regionName(preElement) {
161
+ return (getLanguageLabel(preElement) || 'Code') + ' code block';
162
+ }
163
+ function needsRegionName(preElement) {
164
+ return !!preElement.querySelector('code') &&
165
+ !preElement.hasAttribute('tabindex') &&
166
+ !preElement.hasAttribute('aria-label');
167
+ }
168
+ var regionNameTotals = {};
169
+ var regionNameSeen = {};
170
+ preElements.forEach(function (preElement) {
171
+ if (!needsRegionName(preElement)) return;
172
+ var name = regionName(preElement);
173
+ regionNameTotals[name] = (regionNameTotals[name] || 0) + 1;
174
+ });
175
+
155
176
  preElements.forEach(function (preElement) {
156
177
  var codeElement = preElement.querySelector('code');
157
178
  if (!codeElement) return;
158
179
 
180
+ var labelRegion = needsRegionName(preElement);
181
+
159
182
  ensureLineNumbers(preElement, codeElement);
160
183
 
161
184
  // a11y (WCAG 2.1.1 scrollable-region-focusable): a code block that can
@@ -164,8 +187,13 @@ document.addEventListener('DOMContentLoaded', function () {
164
187
  if (!preElement.hasAttribute('tabindex')) {
165
188
  preElement.setAttribute('tabindex', '0');
166
189
  if (!preElement.hasAttribute('role')) preElement.setAttribute('role', 'region');
167
- if (!preElement.hasAttribute('aria-label')) {
168
- preElement.setAttribute('aria-label', (getLanguageLabel(preElement) || 'Code') + ' code block');
190
+ if (labelRegion) {
191
+ var name = regionName(preElement);
192
+ if (regionNameTotals[name] > 1) {
193
+ regionNameSeen[name] = (regionNameSeen[name] || 0) + 1;
194
+ name += ' ' + regionNameSeen[name];
195
+ }
196
+ preElement.setAttribute('aria-label', name);
169
197
  }
170
198
  }
171
199
 
@@ -930,7 +930,7 @@
930
930
  L.push(' enabled: ' + (c.on('posthog') && f['posthog.api_key'] ? 'true' : 'false'));
931
931
  L.push(' api_key: ' + y(f['posthog.api_key'] || ''));
932
932
  L.push('cookie_consent:');
933
- L.push(' enabled: true');
933
+ L.push(' # enabled unset = the banner shows only when an analytics key above is set');
934
934
  L.push(' expiry_days: 365');
935
935
  L.push('giscus:');
936
936
  L.push(' enabled: ' + (c.on('giscus') && f['giscus.repo_id'] && f['giscus.category_id'] ? 'true' : 'false'));
@@ -1250,7 +1250,7 @@
1250
1250
  ' {%- when "cta" -%}',
1251
1251
  ' <div class="text-center">{% if s.cta %}{% include components/cta-button.html label=s.cta.label url=s.cta.url variant="light" size="lg" %}{% endif %}</div>',
1252
1252
  ' {%- when "latest_posts" -%}',
1253
- ' <div class="row g-4">{% for post in site.posts limit: s.limit | default: 3 %}<div class="col-md-4"><a class="card h-100 text-decoration-none" href="{{ post.url | relative_url }}"><div class="card-body"><p class="small text-body-secondary mb-1">{{ post.date | date: "%B %-d, %Y" }}</p><h3 class="h5 card-title">{{ post.title }}</h3><p class="card-text text-body-secondary mb-0">{{ post.description | default: post.excerpt | strip_html | truncate: 140 }}</p></div></a></div>{% endfor %}</div>',
1253
+ ' <div class="row g-4">{% assign post_limit = s.limit | default: 3 %}{% for post in site.posts limit: post_limit %}<div class="col-md-4"><a class="card h-100 text-decoration-none" href="{{ post.url | relative_url }}"><div class="card-body"><p class="small text-body-secondary mb-1">{{ post.date | date: "%B %-d, %Y" }}</p><h3 class="h5 card-title">{{ post.title }}</h3><p class="card-text text-body-secondary mb-0">{{ post.description | default: post.excerpt | strip_html | truncate: 140 }}</p></div></a></div>{% endfor %}</div>',
1254
1254
  ' {%- when "quote" -%}',
1255
1255
  ' {% assign q = s.items | first %}<figure class="text-center mb-0"><blockquote class="blockquote fs-3"><p>“{{ q.quote }}”</p></blockquote>{% if q.author %}<figcaption class="blockquote-footer mt-2">{{ q.author }}</figcaption>{% endif %}</figure>',
1256
1256
  ' {%- else -%}',
@@ -139,6 +139,51 @@
139
139
  sections.forEach(section => observer.observe(section));
140
140
  }
141
141
 
142
+ /**
143
+ * Give every GFM task-list checkbox an accessible name (#573).
144
+ *
145
+ * kramdown emits `<li class="task-list-item"><input class="task-list-item-checkbox">Text`
146
+ * with no `<label>`, so axe `label` fires on every box (WCAG 1.3.1 / 4.1.2).
147
+ * The item's own text — the nodes after the box, stopping at a nested list —
148
+ * is wrapped in a `<span id>` and the box points at it with `aria-labelledby`.
149
+ * A `<label>` wrapper is deliberately not used: it would make the text a click
150
+ * target, which changes behaviour for sites that make the boxes interactive.
151
+ * Boxes that already carry `aria-label` / `aria-labelledby` are left alone.
152
+ */
153
+ let taskLabelSeq = 0;
154
+
155
+ function labelTaskListCheckboxes(root) {
156
+ const scope = root || document;
157
+ scope.querySelectorAll('.task-list-item-checkbox').forEach(box => {
158
+ if (box.hasAttribute('aria-label') || box.hasAttribute('aria-labelledby')) return;
159
+ const container = box.parentNode;
160
+ if (!container) return;
161
+
162
+ const own = [];
163
+ for (let node = box.nextSibling; node; node = node.nextSibling) {
164
+ if (node.nodeType === Node.ELEMENT_NODE && /^(UL|OL)$/.test(node.nodeName)) break;
165
+ own.push(node);
166
+ }
167
+ const text = own.map(node => node.textContent).join('').trim();
168
+ if (!text) return;
169
+
170
+ let id;
171
+ do {
172
+ taskLabelSeq += 1;
173
+ id = 'task-list-label-' + taskLabelSeq;
174
+ } while (document.getElementById(id));
175
+
176
+ const span = document.createElement('span');
177
+ span.id = id;
178
+ container.insertBefore(span, own[0]);
179
+ own.forEach(node => span.appendChild(node));
180
+ box.setAttribute('aria-labelledby', id);
181
+ });
182
+ }
183
+
184
+ // Exposed so content rendered after load (and tests) can label new lists.
185
+ window.zer0LabelTaskLists = labelTaskListCheckboxes;
186
+
142
187
  /**
143
188
  * Initialize all enhancements
144
189
  */
@@ -155,6 +200,7 @@
155
200
  initImageLoading();
156
201
  initButtonRipples();
157
202
  initScrollSpy();
203
+ labelTaskListCheckboxes();
158
204
  }
159
205
 
160
206
  // Start initialization
data/scripts/ai/README.md CHANGED
@@ -31,7 +31,7 @@ Auth from the job env, OAuth first (`CLAUDE_CODE_OAUTH_TOKEN`, then `ANTHROPIC_A
31
31
  tools: "Read,Grep,Glob,Bash(gh:*)"
32
32
  ```
33
33
 
34
- Inputs: `prompt`, `agent`, `tools`, `mcp`, `system`, `out`, `model`, `max-turns`. Callers in this repo: `issue-autopilot.yml` (triage, verify, resolve) and `visual-evidence-autogen.yml`. Where a lane is the standard shape (gate on a `*_ENABLED` variable, run one agent, open one PR), the hub also offers the reusable `bamr87/bamr87/.github/workflows/ai-lane.yml@main`; the matrix-fed autopilot is deliberately not that shape.
34
+ Inputs: `prompt`, `agent`, `tools`, `mcp`, `system`, `out`, `model`, `max-turns`, `max-budget-usd` (default 10). Callers in this repo: `issue-autopilot.yml` (triage, verify, resolve), `visual-evidence-autogen.yml`, `ai-content-review.yml`, `ci-self-repair.yml` and `ui-audit.yml`; each passes `AI_AUTH_ORDER: ${{ vars.CLAUDE_AUTH_ORDER }}` so the runner tries the credentials in this repo's order. Where a lane is the standard shape (gate on a `*_ENABLED` variable, run one agent, open one PR), the hub also offers the reusable `bamr87/bamr87/.github/workflows/ai-lane.yml@main`; the matrix-fed autopilot is deliberately not that shape.
35
35
 
36
36
  ## Metering companions are kit files too
37
37