jekyll-theme-zer0 1.31.2 → 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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +183 -0
  3. data/_data/ai.yml +1 -1
  4. data/_data/backlog.yml +149 -28
  5. data/_data/features.yml +173 -17
  6. data/_data/navigation/admin.yml +26 -8
  7. data/_data/navigation/docs.yml +2 -8
  8. data/_data/site_builder.yml +1 -1
  9. data/_data/theme-manifest.yml +74 -58
  10. data/_data/ui-text.yml +9 -0
  11. data/_includes/README.md +2 -1
  12. data/_includes/analytics/google-analytics.html +46 -9
  13. data/_includes/analytics/posthog.html +101 -77
  14. data/_includes/components/ai-chat.html +3 -3
  15. data/_includes/components/author-bio.html +3 -1
  16. data/_includes/components/author-card.html +9 -9
  17. data/_includes/components/author-eeat.html +13 -3
  18. data/_includes/components/collection-manager.html +2 -2
  19. data/_includes/components/component-showcase.html +7 -7
  20. data/_includes/components/cookie-consent-needed.html +37 -0
  21. data/_includes/components/cookie-consent.html +44 -5
  22. data/_includes/components/page-feedback.html +10 -6
  23. data/_includes/components/post-card.html +2 -2
  24. data/_includes/components/theme-customizer.html +1 -1
  25. data/_includes/content/comments.html +46 -0
  26. data/_includes/content/giscus.html +22 -13
  27. data/_includes/content/intro.html +39 -3
  28. data/_includes/content/jsonld-software.html +4 -9
  29. data/_includes/content/sitemap.html +173 -17
  30. data/_includes/core/favicon.html +42 -6
  31. data/_includes/core/footer.html +38 -17
  32. data/_includes/core/header.html +11 -2
  33. data/_includes/navigation/admin-nav.html +110 -63
  34. data/_includes/navigation/section-sidebar.html +20 -20
  35. data/_includes/navigation/sidebar-config.html +17 -8
  36. data/_includes/navigation/sidebar-right.html +16 -2
  37. data/_includes/setup/wizard.html +2 -2
  38. data/_layouts/README.md +1 -1
  39. data/_layouts/admin.html +49 -20
  40. data/_layouts/article.html +10 -10
  41. data/_layouts/book-story.html +3 -7
  42. data/_layouts/default.html +63 -2
  43. data/_layouts/news.html +8 -7
  44. data/_layouts/note.html +2 -6
  45. data/_layouts/notebook.html +2 -6
  46. data/_layouts/recipe.html +3 -7
  47. data/_layouts/root.html +7 -4
  48. data/_layouts/section.html +43 -42
  49. data/_sass/components/_back-to-top.scss +9 -0
  50. data/_sass/components/_cookie-banner.scss +31 -0
  51. data/_sass/components/_page-feedback.scss +1 -1
  52. data/_sass/components/_ui-enhancements.scss +22 -0
  53. data/_sass/core/_nav-tree.scss +10 -2
  54. data/_sass/core/_navbar.scss +19 -5
  55. data/_sass/core/_obsidian.scss +19 -3
  56. data/_sass/core/_sidebar-categories.scss +4 -2
  57. data/_sass/core/_sidebar-extras.scss +3 -2
  58. data/_sass/layouts/_admin.scss +60 -0
  59. data/_sass/layouts/_navbar-extras.scss +7 -2
  60. data/_sass/theme/_skins.scss +124 -32
  61. data/_sass/tokens/_color.scss +3 -0
  62. data/_sass/tokens/_layers.scss +12 -5
  63. data/_sass/utilities/_focus.scss +12 -1
  64. data/assets/css/main.scss +1 -0
  65. data/assets/js/code-copy.js +30 -2
  66. data/assets/js/modules/navigation/index.js +94 -40
  67. data/assets/js/modules/navigation/scroll-spy.js +70 -7
  68. data/assets/js/setup-wizard.js +2 -2
  69. data/assets/js/ui-enhancements.js +46 -0
  70. data/scripts/ai/README.md +1 -1
  71. data/scripts/ai/api_call.rb +1 -1
  72. data/scripts/bin/audit-consumer +155 -8
  73. data/scripts/bin/manifest +27 -8
  74. data/scripts/bin/validate +3 -2
  75. data/scripts/ci/test_visual_evidence_autogen.py +53 -1
  76. data/scripts/ci/visual_evidence_autogen.py +26 -7
  77. data/scripts/install/ai/client.sh +1 -1
  78. data/scripts/lib/audit.sh +156 -0
  79. data/scripts/lib/preview_generator.py +1 -1
  80. data/scripts/translate.rb +1 -1
  81. data/scripts/validate-features.rb +20 -2
  82. metadata +5 -2
@@ -43,8 +43,17 @@
43
43
  {% comment %} ================================ {% endcomment %}
44
44
  {% comment %} UI strings resolve per page language (core/i18n.html sets `ui`) {% endcomment %}
45
45
  {%- include core/i18n.html -%}
46
- {% comment %} Accessibility: allows keyboard users to skip navigation {% endcomment %}
47
- <a href="#main-content" class="visually-hidden-focusable position-absolute top-0 start-0 z-3 m-3 btn btn-primary">
46
+ {% comment %} Accessibility: allows keyboard users to skip navigation.
47
+ Target: `#main-content` (the single <main> in root.html) unless the page or
48
+ a layout in its chain sets `skip_link_target` in front matter. Layouts with
49
+ their own navigation inside <main> point it past that chrome, e.g.
50
+ default.html (docs sidebar + TOC) → `page-content`. Jekyll merges layout
51
+ front matter up the chain with the innermost layout winning, so a child
52
+ layout (a site's quest layout, say) can override its parent's target.
53
+ `.zer0-skip-to-content` lifts it above the fixed-top navbar when focused
54
+ (_sass/utilities/_focus.scss); `z-3` left it underneath, invisible. {% endcomment %}
55
+ {%- assign skip_link_target = page.skip_link_target | default: layout.skip_link_target | default: "main-content" -%}
56
+ <a href="#{{ skip_link_target }}" class="zer0-skip-to-content visually-hidden-focusable position-absolute top-0 start-0 m-3 btn btn-primary">
48
57
  {{ ui.skip_main_content | default: "Skip to main content" }}
49
58
  </a>
50
59
 
@@ -7,9 +7,25 @@
7
7
  File: admin-nav.html
8
8
  Path: _includes/navigation/admin-nav.html
9
9
  Purpose: Renders a vertical nav list for administrative pages.
10
- Items are read from _data/navigation/admin.yml.
11
- Highlights the active page based on page.url or
12
- page.admin_section matching.
10
+ Items are read from _data/navigation/admin.yml and listed
11
+ under their `group:` (Configure / System / Links), groups in
12
+ order of first appearance. Highlights the active page based
13
+ on page.url or page.admin_section matching.
14
+ Params: id_prefix (string, optional, default: "admin-nav") — prefix
15
+ for the group-label ids. _layouts/admin.html renders this
16
+ include twice (desktop sidebar + mobile offcanvas), so each
17
+ call passes its own prefix to keep the ids unique.
18
+
19
+ Markup: One .nav.nav-pills list. Each group is a list item holding a
20
+ small-caps label (plain text, not a heading, so the page
21
+ outline stays h1 → content) and a nested list named by that
22
+ label via aria-labelledby. Items without a `group:` render in
23
+ one unlabelled list, so a data file written before groups
24
+ existed keeps working (its external links keep the <hr>).
25
+ Active item: .active + fw-semibold + aria-current, drawn as a
26
+ skin tint by _sass/components/_admin-nav.scss (no solid
27
+ primary fill). Counts render as plain numerals; statuses as
28
+ a coloured dot (aria-hidden) plus a word.
13
29
 
14
30
  Dependencies: Bootstrap 5 nav component, Bootstrap Icons,
15
31
  _data/navigation/admin.yml
@@ -19,78 +35,109 @@
19
35
 
20
36
  {% assign current_path = page.url %}
21
37
  {% assign admin_items = site.data.navigation.admin %}
38
+ {% assign id_prefix = include.id_prefix | default: "admin-nav" %}
22
39
 
23
- <ul class="nav nav-pills flex-column">
40
+ {% comment %} Group names in order of first appearance ("" = no group) {% endcomment %}
41
+ {% assign group_names = "" | split: "" %}
42
+ {% for item in admin_items %}
43
+ {% assign item_group = item.group | default: "" %}
44
+ {% unless group_names contains item_group %}
45
+ {% assign group_names = group_names | push: item_group %}
46
+ {% endunless %}
47
+ {% endfor %}
24
48
 
25
- {% assign rendered_separator = false %}
26
- {% for item in admin_items %}
49
+ <ul class="nav nav-pills flex-column admin-nav">
27
50
 
28
- {% if item.external and rendered_separator == false %}
29
- {% assign rendered_separator = true %}
30
- <li class="nav-item" aria-hidden="true"><hr class="my-2"></li>
51
+ {% for group_name in group_names %}
52
+ {% assign group_id = id_prefix | append: "-group-" | append: forloop.index %}
53
+ <li class="nav-item admin-nav-group">
54
+ {% if group_name != "" %}
55
+ <span class="admin-nav-group-label" id="{{ group_id }}">{{ group_name }}</span>
31
56
  {% endif %}
57
+ <ul class="nav flex-column"{% if group_name != "" %} aria-labelledby="{{ group_id }}"{% endif %}>
32
58
 
33
- {% comment %} Active detection: exact URL match or admin_section match {% endcomment %}
34
- {% assign is_active = false %}
35
- {% if current_path == item.url %}
36
- {% assign is_active = true %}
37
- {% elsif page.admin_section and page.admin_section == item.title %}
38
- {% assign is_active = true %}
39
- {% endif %}
59
+ {% assign rendered_separator = false %}
60
+ {% for item in admin_items %}
61
+ {% assign item_group = item.group | default: "" %}
62
+ {% if item_group == group_name %}
40
63
 
41
- {% comment %} Dynamic badges when no static badge is set {% endcomment %}
42
- {% assign dynamic_badge = nil %}
43
- {% assign badge_class = "bg-secondary" %}
44
- {% unless item.badge or item.external %}
45
- {% if item.url == "/about/settings/collections/" %}
46
- {% assign dynamic_badge = site.collections | size %}
47
- {% elsif item.url == "/about/settings/analytics/" %}
48
- {% if site.posthog.enabled %}
49
- {% assign dynamic_badge = "On" %}
50
- {% assign badge_class = "bg-success" %}
51
- {% else %}
52
- {% assign dynamic_badge = "Off" %}
53
- {% assign badge_class = "bg-secondary" %}
64
+ {% if group_name == "" and item.external and rendered_separator == false %}
65
+ {% assign rendered_separator = true %}
66
+ <li class="nav-item" aria-hidden="true"><hr class="my-2"></li>
67
+ {% endif %}
68
+
69
+ {% comment %} Active detection: exact URL match or admin_section match {% endcomment %}
70
+ {% assign is_active = false %}
71
+ {% assign current_kind = "page" %}
72
+ {% if current_path == item.url %}
73
+ {% assign is_active = true %}
74
+ {% elsif page.admin_section and page.admin_section == item.title %}
75
+ {% assign is_active = true %}
76
+ {% comment %} The link is this page's section, not this page {% endcomment %}
77
+ {% assign current_kind = "true" %}
78
+ {% endif %}
79
+
80
+ {% comment %} Dynamic count or status when no static badge is set {% endcomment %}
81
+ {% assign item_count = nil %}
82
+ {% assign item_status = nil %}
83
+ {% assign status_tone = "secondary" %}
84
+ {% unless item.badge or item.external %}
85
+ {% if item.url == "/about/settings/collections/" %}
86
+ {% assign item_count = site.collections | size %}
87
+ {% elsif item.url == "/about/settings/analytics/" %}
88
+ {% if site.posthog.enabled %}
89
+ {% assign item_status = "On" %}
90
+ {% assign status_tone = "success" %}
91
+ {% else %}
92
+ {% assign item_status = "Off" %}
93
+ {% endif %}
94
+ {% elsif item.url == "/about/settings/environment/" %}
95
+ {% if jekyll.environment == "production" %}
96
+ {% assign item_status = "Prod" %}
97
+ {% assign status_tone = "success" %}
98
+ {% else %}
99
+ {% assign item_status = "Dev" %}
100
+ {% assign status_tone = "warning" %}
101
+ {% endif %}
54
102
  {% endif %}
55
- {% elsif item.url == "/about/settings/environment/" %}
56
- {% if jekyll.environment == "production" %}
57
- {% assign dynamic_badge = "Prod" %}
58
- {% assign badge_class = "bg-success" %}
103
+ {% endunless %}
104
+
105
+ <li class="nav-item">
106
+ {% if item.external %}
107
+ {% comment %} Resolve placeholder tokens for external URLs {% endcomment %}
108
+ {% assign resolved_url = item.url
109
+ | replace: '{github_user}', site.github_user
110
+ | replace: '{repository_name}', site.repository_name %}
111
+ <a class="nav-link d-flex align-items-center text-body-secondary"
112
+ href="{{ resolved_url }}"
113
+ target="_blank" rel="noopener">
114
+ <i class="{{ item.icon }} me-2" aria-hidden="true"></i>
115
+ {{ item.title }}
116
+ <i class="bi bi-box-arrow-up-right ms-auto small" aria-hidden="true"></i>
117
+ </a>
59
118
  {% else %}
60
- {% assign dynamic_badge = "Dev" %}
61
- {% assign badge_class = "bg-warning text-dark" %}
119
+ <a class="nav-link d-flex align-items-center{% if is_active %} active fw-semibold{% endif %}"
120
+ href="{{ item.url | relative_url }}"
121
+ {% if is_active %}aria-current="{{ current_kind }}"{% endif %}
122
+ {% if item.description %}title="{{ item.description }}"{% endif %}>
123
+ <i class="{{ item.icon }} me-2" aria-hidden="true"></i>
124
+ {{ item.title }}
125
+ {% if item.badge %}
126
+ <span class="admin-nav-meta ms-auto">{{ item.badge }}</span>
127
+ {% elsif item_count %}
128
+ <span class="admin-nav-meta admin-nav-count ms-auto">{{ item_count }}</span>
129
+ {% elsif item_status %}
130
+ <span class="admin-nav-meta admin-nav-status ms-auto"><span class="admin-nav-dot bg-{{ status_tone }}" aria-hidden="true"></span>{{ item_status }}</span>
131
+ {% endif %}
132
+ </a>
62
133
  {% endif %}
63
- {% endif %}
64
- {% endunless %}
134
+ </li>
65
135
 
66
- <li class="nav-item">
67
- {% if item.external %}
68
- {% comment %} Resolve placeholder tokens for external URLs {% endcomment %}
69
- {% assign resolved_url = item.url
70
- | replace: '{github_user}', site.github_user
71
- | replace: '{repository_name}', site.repository_name %}
72
- <a class="nav-link d-flex align-items-center text-body-secondary"
73
- href="{{ resolved_url }}"
74
- target="_blank" rel="noopener">
75
- <i class="{{ item.icon }} me-2"></i>
76
- {{ item.title }}
77
- <i class="bi bi-box-arrow-up-right ms-auto small"></i>
78
- </a>
79
- {% else %}
80
- <a class="nav-link d-flex align-items-center{% if is_active %} active{% endif %}"
81
- href="{{ item.url | relative_url }}"
82
- {% if item.description %}title="{{ item.description }}"{% endif %}>
83
- <i class="{{ item.icon }} me-2"></i>
84
- {{ item.title }}
85
- {% if item.badge %}
86
- <span class="badge bg-secondary ms-auto">{{ item.badge }}</span>
87
- {% elsif dynamic_badge %}
88
- <span class="badge {{ badge_class }} ms-auto">{{ dynamic_badge }}</span>
89
- {% endif %}
90
- </a>
91
136
  {% endif %}
92
- </li>
137
+ {% endfor %}
93
138
 
139
+ </ul>
140
+ </li>
94
141
  {% endfor %}
95
142
 
96
143
  </ul>
@@ -74,36 +74,36 @@
74
74
  {% comment %} ================================ {% endcomment %}
75
75
  {% comment %} DESKTOP SIDEBAR (Fixed Sticky) {% endcomment %}
76
76
  {% comment %} ================================ {% endcomment %}
77
- <aside class="section-sidebar-desktop d-none d-lg-block w-100">
77
+ <aside class="section-sidebar-desktop d-none d-lg-block w-100" aria-label="{{ page_title | escape }} sidebar">
78
78
  <div class="position-sticky" style="top: 80px;">
79
79
 
80
80
  {% comment %} Topics Card {% endcomment %}
81
81
  <div class="card border-0 shadow-sm">
82
82
  <div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
83
- <h5 class="mb-0">
84
- <i class="bi bi-bookmark me-2"></i>Topics
85
- </h5>
83
+ <h2 class="h5 mb-0">
84
+ <i class="bi bi-bookmark me-2" aria-hidden="true"></i>Topics
85
+ </h2>
86
86
  <span class="badge bg-light text-primary">{{ sub_categories.size }}</span>
87
87
  </div>
88
88
  <div class="card-body p-0">
89
- <nav class="nav flex-column sidebar-nav">
89
+ <nav class="nav flex-column sidebar-nav" aria-label="{{ page_title | escape }} topics">
90
90
  {% if _anchors_resolve %}
91
91
  <a class="nav-link active" href="#all-posts" data-section="all-posts">
92
- <i class="bi bi-grid me-2"></i>
92
+ <i class="bi bi-grid me-2" aria-hidden="true"></i>
93
93
  <span class="nav-text">All Articles</span>
94
94
  <span class="badge bg-secondary ms-auto">{{ section_posts.size }}</span>
95
95
  </a>
96
96
  {% for subcat in _linkable_subcats %}
97
97
  {% assign subcat_posts = section_posts | where_exp: "post", "post.tags contains subcat" %}
98
98
  <a class="nav-link" href="#{{ subcat | slugify }}" data-section="{{ subcat | slugify }}">
99
- <i class="bi bi-tag me-2"></i>
99
+ <i class="bi bi-tag me-2" aria-hidden="true"></i>
100
100
  <span class="nav-text">{{ subcat | capitalize }}</span>
101
101
  <span class="badge bg-light text-dark ms-auto">{{ subcat_posts.size }}</span>
102
102
  </a>
103
103
  {% endfor %}
104
104
  {% else %}
105
105
  <button type="button" class="nav-link text-start active" data-filter="all">
106
- <i class="bi bi-grid me-2"></i>
106
+ <i class="bi bi-grid me-2" aria-hidden="true"></i>
107
107
  <span class="nav-text">All Articles</span>
108
108
  <span class="badge bg-secondary ms-auto">{{ section_posts.size }}</span>
109
109
  </button>
@@ -111,7 +111,7 @@
111
111
  {% assign subcat_posts = section_posts | where_exp: "post", "post.tags contains subcat" %}
112
112
  {% if subcat_posts.size > 0 %}
113
113
  <button type="button" class="nav-link text-start" data-filter="{{ subcat | slugify }}">
114
- <i class="bi bi-tag me-2"></i>
114
+ <i class="bi bi-tag me-2" aria-hidden="true"></i>
115
115
  <span class="nav-text">{{ subcat | capitalize }}</span>
116
116
  <span class="badge bg-light text-dark ms-auto">{{ subcat_posts.size }}</span>
117
117
  </button>
@@ -128,7 +128,7 @@
128
128
  {% if sub_categories.size > 15 and _tags_page %}
129
129
  <div class="card-footer bg-transparent">
130
130
  <a href="{{ _tags_url | relative_url }}" class="btn btn-sm btn-outline-secondary w-100">
131
- View All Tags <i class="bi bi-arrow-right ms-1"></i>
131
+ View All Tags <i class="bi bi-arrow-right ms-1" aria-hidden="true"></i>
132
132
  </a>
133
133
  </div>
134
134
  {% endif %}
@@ -137,9 +137,9 @@
137
137
  {% comment %} Section Stats {% endcomment %}
138
138
  <div class="card border-0 shadow-sm mt-3">
139
139
  <div class="card-body">
140
- <h6 class="text-muted mb-3">
141
- <i class="bi bi-graph-up me-2"></i>Section Stats
142
- </h6>
140
+ <h3 class="h6 text-muted mb-3">
141
+ <i class="bi bi-graph-up me-2" aria-hidden="true"></i>Section Stats
142
+ </h3>
143
143
  <div class="d-flex justify-content-between mb-2">
144
144
  <small class="text-muted">Total Articles</small>
145
145
  <strong>{{ section_posts.size }}</strong>
@@ -164,34 +164,34 @@
164
164
  <div class="offcanvas offcanvas-start" tabindex="-1" id="{{ sidebar_id }}" aria-labelledby="{{ sidebar_id }}Label">
165
165
  <div class="offcanvas-header bg-primary text-white">
166
166
  <h2 class="offcanvas-title h5" id="{{ sidebar_id }}Label">
167
- <i class="bi bi-bookmark me-2"></i>{{ page_title }} Topics
167
+ <i class="bi bi-bookmark me-2" aria-hidden="true"></i>{{ page_title }} Topics
168
168
  </h2>
169
169
  <button type="button" class="btn-close btn-close-white" data-bs-dismiss="offcanvas" aria-label="Close"></button>
170
170
  </div>
171
171
  <div class="offcanvas-body p-0">
172
- <nav class="nav flex-column">
172
+ <nav class="nav flex-column" aria-labelledby="{{ sidebar_id }}Label">
173
173
  {% if _anchors_resolve %}
174
174
  <a class="nav-link active bg-light py-3 border-bottom" href="#all-posts" data-bs-dismiss="offcanvas">
175
- <i class="bi bi-grid me-2"></i>All Articles
175
+ <i class="bi bi-grid me-2" aria-hidden="true"></i>All Articles
176
176
  <span class="badge bg-secondary float-end">{{ section_posts.size }}</span>
177
177
  </a>
178
178
  {% for subcat in _linkable_subcats %}
179
179
  {% assign subcat_posts = section_posts | where_exp: "post", "post.tags contains subcat" %}
180
180
  <a class="nav-link text-body-secondary py-3 border-bottom" href="#{{ subcat | slugify }}" data-bs-dismiss="offcanvas">
181
- <i class="bi bi-tag me-2"></i>{{ subcat | capitalize }}
181
+ <i class="bi bi-tag me-2" aria-hidden="true"></i>{{ subcat | capitalize }}
182
182
  <span class="badge bg-light text-dark float-end">{{ subcat_posts.size }}</span>
183
183
  </a>
184
184
  {% endfor %}
185
185
  {% else %}
186
186
  <button type="button" class="nav-link text-start active bg-light py-3 border-bottom w-100" data-filter="all" data-bs-dismiss="offcanvas">
187
- <i class="bi bi-grid me-2"></i>All Articles
187
+ <i class="bi bi-grid me-2" aria-hidden="true"></i>All Articles
188
188
  <span class="badge bg-secondary float-end">{{ section_posts.size }}</span>
189
189
  </button>
190
190
  {% for subcat in sub_categories %}
191
191
  {% assign subcat_posts = section_posts | where_exp: "post", "post.tags contains subcat" %}
192
192
  {% if subcat_posts.size > 0 %}
193
193
  <button type="button" class="nav-link text-start text-body-secondary py-3 border-bottom w-100" data-filter="{{ subcat | slugify }}" data-bs-dismiss="offcanvas">
194
- <i class="bi bi-tag me-2"></i>{{ subcat | capitalize }}
194
+ <i class="bi bi-tag me-2" aria-hidden="true"></i>{{ subcat | capitalize }}
195
195
  <span class="badge bg-light text-dark float-end">{{ subcat_posts.size }}</span>
196
196
  </button>
197
197
  {% endif %}
@@ -201,7 +201,7 @@
201
201
  {% if _tags_page %}
202
202
  <div class="p-3">
203
203
  <a href="{{ _tags_url | relative_url }}" class="btn btn-outline-primary w-100">
204
- <i class="bi bi-tags me-2"></i>Browse All Tags
204
+ <i class="bi bi-tags me-2" aria-hidden="true"></i>Browse All Tags
205
205
  </a>
206
206
  </div>
207
207
  {% endif %}
@@ -156,15 +156,24 @@
156
156
  Clicking did nothing, and assistive tech followed aria-controls to an element
157
157
  that was not there.
158
158
 
159
- There is no Liquid API for "resolve the layout inheritance chain", so the set
160
- of layouts that reach default.html is listed here explicitly. It is pinned by
161
- a test (test/test_core.sh :: test_sidebar_offcanvas_layout_gate) that reads
162
- the front matter of every _layouts/*.html and fails if reality drifts from
163
- this list — the same invariant pattern #425 used for the pixel-gate filter.
164
- Add a layout here when, and only when, its `layout:` chain reaches default.
159
+ This used to be a hard-coded list of the theme's own layout names, which
160
+ fails CLOSED for every CONSUMER layout: a remote-theme site whose `quest`
161
+ layout declares `layout: default` renders #tocContents but got no #tocFab, so
162
+ below `lg` its table of contents was unreachable (issue #570).
163
+
164
+ The layout chain answers instead. _layouts/default.html declares
165
+ `renders_sidebar_offcanvas: true` in its front matter, and Jekyll's
166
+ Renderer#render_layout deep-merges each layout's data down the chain
167
+ (`payload["layout"] = deep_merge(layout.data, payload["layout"])`), so the key
168
+ is visible as `layout.renders_sidebar_offcanvas` on every page that reaches
169
+ default at ANY depth, from the theme or a consumer. core/header.html already
170
+ relies on the same merge for `skip_link_target`.
171
+
172
+ Still fails safe: a layout that never reaches default declares nothing, so it
173
+ gets no toggle and no dangling aria-controls (#373's invariant). Pinned by
174
+ test/test_core.sh :: test_sidebar_offcanvas_layout_gate.
165
175
  {%- endcomment -%}
166
- {%- assign _sidebar_offcanvas_layouts = "default,article,author,authors,collection,cookbook,note,notebook,recipe,tag" | split: "," -%}
167
176
  {%- assign sidebar_offcanvas_rendered = false -%}
168
- {%- if _sidebar_offcanvas_layouts contains page.layout -%}
177
+ {%- if layout.renders_sidebar_offcanvas -%}
169
178
  {%- assign sidebar_offcanvas_rendered = true -%}
170
179
  {%- endif -%}
@@ -56,9 +56,23 @@
56
56
  Only invoke the Liquid TOC parser when the page actually has headings.
57
57
  A single contains check is far cheaper than running the full toc.html
58
58
  parser (allejo/jekyll-toc) on content with no heading anchors.
59
+
60
+ `content` here is the whole rendered child layout. A layout that adds
61
+ headings around its body (article: the <h1> title, the author bio)
62
+ wraps the body in <zer0-toc-start></zer0-toc-start> and
63
+ <zer0-toc-end></zer0-toc-end>; the TOC then parses only that slice,
64
+ from h2, since the page title already heads the page (#552).
65
+ default.html strips the sentinels from the delivered page. Layouts
66
+ without them are unchanged.
59
67
  {% endcomment %}
60
- {% if content contains '<h2' or content contains '<h3' or content contains '<h4' %}
61
- {% include content/toc.html sanitize=true html=content h_min=1 h_max=3 class="list-group-flush" item_class="list-group-item" anchor_class="" skip_no_ids=true %}
68
+ {% assign toc_src = content %}
69
+ {% assign toc_h_min = 1 %}
70
+ {% if content contains '<zer0-toc-start></zer0-toc-start>' %}
71
+ {% assign toc_src = content | split: '<zer0-toc-start></zer0-toc-start>' | last | split: '<zer0-toc-end></zer0-toc-end>' | first %}
72
+ {% assign toc_h_min = 2 %}
73
+ {% endif %}
74
+ {% if toc_src contains '<h2' or toc_src contains '<h3' or toc_src contains '<h4' %}
75
+ {% include content/toc.html sanitize=true html=toc_src h_min=toc_h_min h_max=3 class="list-group-flush" item_class="list-group-item" anchor_class="" skip_no_ids=true %}
62
76
  {% else %}
63
77
  <p class="text-body-secondary small fst-italic">No sections on this page.</p>
64
78
  {% endif %}
@@ -178,7 +178,7 @@
178
178
  <div class="col-md-6">
179
179
  <label for="sb-model" class="form-label">Model</label>
180
180
  <select class="form-select form-select-sm" id="sb-model" disabled>
181
- <option value="{{ sb_cfg.model | default: site.ai_chat.model | default: 'claude-opus-4-8' }}">{{ sb_cfg.model | default: site.ai_chat.model | default: 'claude-opus-4-8' }}</option>
181
+ <option value="{{ sb_cfg.model | default: site.ai_chat.model | default: 'claude-opus-5-5' }}">{{ sb_cfg.model | default: site.ai_chat.model | default: 'claude-opus-5-5' }}</option>
182
182
  </select>
183
183
  <div class="form-text" id="sb-model-note">Sent with every request; the proxy can pin one with <code>CHAT_MODEL</code> / <code>XAI_CHAT_MODEL</code>.</div>
184
184
  </div>
@@ -1021,7 +1021,7 @@
1021
1021
  "endpoint": {{ sb_cfg.endpoint | default: "/api/wizard" | jsonify }},
1022
1022
  "chatEndpoint": {{ sb_cfg.chat_endpoint | default: site.ai_chat.endpoint | default: "/api/chat" | jsonify }},
1023
1023
  "provider": {{ sb_cfg.provider | default: "auto" | jsonify }},
1024
- "model": {{ sb_cfg.model | default: site.ai_chat.model | default: "claude-opus-4-8" | jsonify }},
1024
+ "model": {{ sb_cfg.model | default: site.ai_chat.model | default: "claude-opus-5-5" | jsonify }},
1025
1025
  "mode": {{ sb_cfg.mode | default: "guided" | jsonify }},
1026
1026
  "imageProvider": {{ sb_cfg.image_provider | default: "" | jsonify }},
1027
1027
  "maxTokens": {{ sb_cfg.max_tokens | default: 8192 }},
data/_layouts/README.md CHANGED
@@ -58,7 +58,7 @@ root.html (base template)
58
58
  - **Purpose**: Single article display with post_type variations
59
59
  - **Features**: Conditional rendering based on `post_type` front matter
60
60
  - **Post Types**: standard, featured, breaking, opinion, review, tutorial, listicle, interview
61
- - **Dependencies**: post-type-badge.html, giscus.html for comments
61
+ - **Dependencies**: post-type-badge.html, content/comments.html for comments
62
62
  - **Usage**: Individual news articles and blog posts
63
63
 
64
64
  #### `section.html`
data/_layouts/admin.html CHANGED
@@ -19,13 +19,18 @@ layout: root
19
19
  - Admin header with page icon, title, and breadcrumb navigation
20
20
  - No author byline, reading time, or share buttons
21
21
  - Responsive: sidebar collapses to offcanvas on mobile
22
+ - Header actions stay reachable at every width: the first is a
23
+ button, the rest sit in a "More actions" dropdown
22
24
  - Supports front matter: icon, admin_nav (true/false)
23
25
 
24
26
  Front Matter Variables:
25
27
  - icon: Bootstrap Icon class for header (e.g., "bi-gear")
26
28
  - admin_nav: Show admin sidebar navigation (default: true)
27
29
  - admin_section: Active section name for sidebar highlighting
28
- - admin_actions: Array of {label, url, icon, style} for header buttons
30
+ - admin_actions: Array of {label, url, icon, style} for header actions.
31
+ The first renders as a button (style applies, default
32
+ btn-outline-secondary); any further entries render as items of
33
+ a "More actions" dropdown (style is ignored there)
29
34
 
30
35
  Layout Structure:
31
36
  1. Admin header with breadcrumbs, icon, title, description, actions
@@ -61,8 +66,8 @@ layout: root
61
66
  </ol>
62
67
  </nav>
63
68
 
64
- {% comment %} Title row {% endcomment %}
65
- <div class="d-flex align-items-center">
69
+ {% comment %} Title row (actions wrap onto their own line below md) {% endcomment %}
70
+ <div class="d-flex flex-wrap align-items-center row-gap-2">
66
71
  {% comment %} Mobile sidebar toggle {% endcomment %}
67
72
  {% if show_sidebar %}
68
73
  <button class="btn btn-outline-secondary me-3 d-lg-none"
@@ -80,26 +85,52 @@ layout: root
80
85
  {% else %}
81
86
  <i class="bi bi-gear fs-2 me-3 text-primary"></i>
82
87
  {% endif %}
83
- <div class="me-auto">
88
+ <div class="admin-header-title me-3">
84
89
  <h1 class="h3 mb-0">{{ page.title }}</h1>
85
90
  {% if page.excerpt and page.excerpt != empty %}
86
91
  <p class="text-body-secondary mb-0 small">{{ page.excerpt | strip_html }}</p>
87
92
  {% endif %}
88
93
  {% if page.lastmod %}
89
- <small class="text-body-tertiary"><i class="bi bi-clock me-1"></i>Updated {{ page.lastmod | date: "%b %d, %Y" }}</small>
94
+ <small class="text-body-secondary"><i class="bi bi-clock me-1"></i>Updated {{ page.lastmod | date: "%b %d, %Y" }}</small>
90
95
  {% endif %}
91
96
  </div>
92
97
 
93
- {% comment %} Page-level action buttons (from front matter admin_actions) {% endcomment %}
94
- {% if page.admin_actions %}
95
- <div class="d-none d-md-flex gap-2 ms-3">
96
- {% for action in page.admin_actions %}
97
- <a href="{{ action.url | relative_url }}"
98
- class="btn btn-sm {{ action.style | default: 'btn-outline-secondary' }}">
99
- {% if action.icon %}<i class="{{ action.icon }} me-1"></i>{% endif %}
100
- {{ action.label }}
101
- </a>
102
- {% endfor %}
98
+ {% comment %}
99
+ Page-level actions (from front matter admin_actions). The first is a
100
+ button at every width; any further entries sit in a "More actions"
101
+ dropdown, so every action is reachable on a phone.
102
+ {% endcomment %}
103
+ {% if page.admin_actions and page.admin_actions.size > 0 %}
104
+ {% assign primary_action = page.admin_actions | first %}
105
+ <div class="admin-actions d-flex align-items-center gap-2 ms-auto">
106
+ <a href="{{ primary_action.url | relative_url }}"
107
+ class="btn btn-sm {{ primary_action.style | default: 'btn-outline-secondary' }}">
108
+ {% if primary_action.icon %}<i class="{{ primary_action.icon }} me-1" aria-hidden="true"></i>{% endif %}
109
+ {{ primary_action.label }}
110
+ </a>
111
+ {% if page.admin_actions.size > 1 %}
112
+ <div class="dropdown">
113
+ <button class="btn btn-sm btn-outline-secondary"
114
+ type="button"
115
+ id="adminActionsMenu"
116
+ data-bs-toggle="dropdown"
117
+ aria-expanded="false"
118
+ aria-label="More actions"
119
+ title="More actions">
120
+ <i class="bi bi-three-dots" aria-hidden="true"></i>
121
+ </button>
122
+ <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="adminActionsMenu">
123
+ {% for action in page.admin_actions offset: 1 %}
124
+ <li>
125
+ <a class="dropdown-item" href="{{ action.url | relative_url }}">
126
+ {% if action.icon %}<i class="{{ action.icon }} me-2" aria-hidden="true"></i>{% endif %}
127
+ {{ action.label }}
128
+ </a>
129
+ </li>
130
+ {% endfor %}
131
+ </ul>
132
+ </div>
133
+ {% endif %}
103
134
  </div>
104
135
  {% endif %}
105
136
  </div>
@@ -123,10 +154,8 @@ layout: root
123
154
  <div class="col-lg-3 d-none d-lg-block">
124
155
  <div class="position-sticky" style="top: 5rem;">
125
156
  <nav class="admin-sidebar" aria-label="Admin navigation">
126
- <h6 class="text-uppercase text-body-secondary fw-semibold small mb-3">
127
- <i class="bi bi-sliders me-1"></i> Administration
128
- </h6>
129
- {% include navigation/admin-nav.html %}
157
+ {% comment %} No heading here: the offcanvas header below owns the one "Administration" heading {% endcomment %}
158
+ {% include navigation/admin-nav.html id_prefix="admin-nav-desktop" %}
130
159
  </nav>
131
160
  </div>
132
161
  </div>
@@ -141,7 +170,7 @@ layout: root
141
170
  <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
142
171
  </div>
143
172
  <div class="offcanvas-body">
144
- {% include navigation/admin-nav.html %}
173
+ {% include navigation/admin-nav.html id_prefix="admin-nav-offcanvas" %}
145
174
  </div>
146
175
  </div>
147
176
 
@@ -39,7 +39,7 @@ layout: default
39
39
 
40
40
  Dependencies:
41
41
  - components/post-type-badge.html: Post type badge display
42
- - content/giscus.html: GitHub Discussions comment system
42
+ - content/comments.html: comment section (gate, heading, giscus widget)
43
43
  - site.giscus configuration for comment system
44
44
  - Bootstrap 5 components
45
45
  ===================================================================
@@ -359,7 +359,7 @@ layout: default
359
359
  {% comment %} LISTICLE QUICK NAV {% endcomment %}
360
360
  {% comment %} ================================ {% endcomment %}
361
361
  {% if post_type == "listicle" %}
362
- <nav class="listicle-nav card border-0 bg-body-tertiary mb-4">
362
+ <nav class="listicle-nav card border-0 bg-body-tertiary mb-4" aria-label="Quick navigation">
363
363
  <div class="card-body">
364
364
  <h6 class="card-title mb-2">
365
365
  <i class="bi bi-list-ol me-2"></i>Quick Navigation
@@ -389,8 +389,14 @@ layout: default
389
389
  {% comment %} ================================ {% endcomment %}
390
390
  {% comment %} ARTICLE CONTENT {% endcomment %}
391
391
  {% comment %} ================================ {% endcomment %}
392
+ {% comment %} The zer0-toc-start/end sentinels scope the right-sidebar TOC to the
393
+ body, so the page title and the author-bio aside stay out of it (#552).
394
+ default.html strips them from the delivered page. They are empty elements,
395
+ not HTML comments, so they pass the #375 comment gate. {% endcomment %}
392
396
  <div class="post-content e-content {% if post_type == 'featured' %}fs-5{% endif %}" itemprop="articleBody">
397
+ <zer0-toc-start></zer0-toc-start>
393
398
  {{ content }}
399
+ <zer0-toc-end></zer0-toc-end>
394
400
  </div>
395
401
 
396
402
  {% comment %} ================================ {% endcomment %}
@@ -558,13 +564,7 @@ layout: default
558
564
  {% comment %} ================================ {% endcomment %}
559
565
  {% comment %} COMMENT SYSTEM {% endcomment %}
560
566
  {% comment %} ================================ {% endcomment %}
561
- {% if page.comments != false and site.giscus.enabled %}
562
- <section class="post-comments mt-5 pt-4 border-top" id="comments">
563
- <h2 class="h4 mb-4">
564
- <i class="bi bi-chat-dots me-2"></i>Comments
565
- </h2>
566
- {% include content/giscus.html %}
567
- </section>
568
- {% endif %}
567
+ {% comment %} On unless the page sets comments: false (and site.giscus.enabled). {% endcomment %}
568
+ {% include content/comments.html %}
569
569
 
570
570
  </article>
@@ -1,5 +1,5 @@
1
1
  ---
2
- # Feature: ZER0-080
2
+ # Features: ZER0-035, ZER0-080
3
3
  layout: root
4
4
  ---
5
5
  {%- comment -%}
@@ -82,10 +82,6 @@ layout: root
82
82
  {% comment %} ================================ {% endcomment %}
83
83
  {% comment %} COMMENTS {% endcomment %}
84
84
  {% comment %} ================================ {% endcomment %}
85
- {%- if page.comments and site.giscus.enabled -%}
86
- <section class="post-comments mt-5 pt-4 border-top" id="comments">
87
- <h2 class="h4 mb-4"><i class="bi bi-chat-dots me-2" aria-hidden="true"></i>Comments</h2>
88
- {%- include content/giscus.html -%}
89
- </section>
90
- {%- endif -%}
85
+ {% comment %} Opt-in: only when the page sets comments: true (and site.giscus.enabled). {% endcomment %}
86
+ {%- include content/comments.html default_on=false -%}
91
87
  </article>