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
@@ -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 %}
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>
@@ -4,6 +4,12 @@ layout: root
4
4
  # The skip link (core/header.html) jumps past the docs sidebar, intro and
5
5
  # TOC straight to the page body below.
6
6
  skip_link_target: page-content
7
+ # This layout is the one that emits the #bdSidebar / #tocContents offcanvases.
8
+ # navigation/sidebar-config.html reads this through Jekyll's layout front-matter
9
+ # merge, so every layout whose `layout:` chain reaches here — including a
10
+ # consumer's own — gets the sidebar toggle, TOC FAB and local-graph FAB that go
11
+ # with them (issues #373, #570).
12
+ renders_sidebar_offcanvas: true
7
13
  ---
8
14
  {% comment %}
9
15
  ===================================================================
@@ -129,8 +135,56 @@ skip_link_target: page-content
129
135
  lets the link move keyboard focus here, not just scroll (same reason
130
136
  as #main-content in root.html); its focus ring is suppressed in
131
137
  _sass/utilities/_focus.scss. {% endcomment %}
138
+ {% comment %} The TOC-scope sentinels (#552) have done their job in
139
+ sidebar-right.html above; they never reach the visitor. {% endcomment %}
140
+ {%- comment -%}
141
+ One <h1> per page (issue #593). When the intro above has rendered
142
+ page.title as the page's <h1>, the body must not add a second one —
143
+ yet most Markdown pages open with `# Title` (kramdown emits
144
+ <h1 id="title">), and some child layouts print their own heading.
145
+ So the FIRST <h1> of the body is rewritten, once:
146
+ - it is the body's leading element and its text is page.title
147
+ (compared through slugify, so case, punctuation and a decorative
148
+ emoji do not count): dropped, with its id kept on an empty
149
+ <span> so #anchors and the TOC link still land;
150
+ - anything else (different text, or a heading further in): demoted
151
+ to <h2>, attributes and text intact, so nothing written vanishes.
152
+ The TOC above is built from the original `content`, so its entries
153
+ and levels do not change. Layouts that skip the intro (article, note,
154
+ recipe, cookbook, hide_intro) render the body untouched. The landing
155
+ layout, which does not inherit this one, solves the same problem in
156
+ CSS (`.landing-content-body > h1:first-of-type`).
157
+ {%- endcomment -%}
158
+ {%- assign _page_body = content | remove: '<zer0-toc-start></zer0-toc-start>' | remove: '<zer0-toc-end></zer0-toc-end>' -%}
159
+ {%- assign _h1_title_key = page.title | strip_html | slugify -%}
160
+ {%- assign _h1_rewrite = false -%}
161
+ {%- if _skip_intro == false and _h1_title_key != "" and _page_body contains '<h1' -%}
162
+ {%- assign _h1_before = _page_body | split: '<h1' | first -%}
163
+ {%- assign _h1_rest = _page_body | remove_first: _h1_before -%}
164
+ {%- if _h1_rest contains '</h1>' -%}
165
+ {%- assign _h1_rewrite = true -%}
166
+ {%- assign _h1_inner = _h1_rest | remove_first: '<h1' | split: '</h1>' | first -%}
167
+ {%- assign _h1_html = '<h1' | append: _h1_inner | append: '</h1>' -%}
168
+ {%- assign _h1_after = _h1_rest | remove_first: _h1_html -%}
169
+ {%- assign _h1_attrs = _h1_inner | split: '>' | first | default: '' -%}
170
+ {%- assign _h1_key = _h1_inner | remove_first: _h1_attrs | remove_first: '>' | strip_html | slugify -%}
171
+ {%- assign _h1_id = '' -%}
172
+ {%- if _h1_attrs contains ' id="' -%}
173
+ {%- assign _h1_id = _h1_attrs | split: ' id="' | last | split: '"' | first -%}
174
+ {%- endif -%}
175
+ {%- assign _h1_leading = _h1_before | strip -%}
176
+ {%- if _h1_leading == "" and _h1_key == _h1_title_key -%}
177
+ {%- assign _h1_replacement = '' -%}
178
+ {%- if _h1_id != '' -%}
179
+ {%- assign _h1_replacement = '<span id="' | append: _h1_id | append: '"></span>' -%}
180
+ {%- endif -%}
181
+ {%- else -%}
182
+ {%- assign _h1_replacement = '<h2' | append: _h1_inner | append: '</h2>' -%}
183
+ {%- endif -%}
184
+ {%- endif -%}
185
+ {%- endif %}
132
186
  <div id="page-content" class="bd-content ps-lg-2" tabindex="-1">
133
- {{ content }}
187
+ {% if _h1_rewrite %}{{ _h1_before }}{{ _h1_replacement }}{{ _h1_after }}{% else %}{{ _page_body }}{% endif %}
134
188
 
135
189
  {%- comment -%}
136
190
  Optional Obsidian-style backlinks panel. Opt-in for the generic
data/_layouts/news.html CHANGED
@@ -104,9 +104,10 @@ source: "https://getbootstrap.com/docs/5.3/examples/blog/#"
104
104
  </h1>
105
105
  </div>
106
106
  <div class="col-md-8">
107
- <nav class="nav nav-pills justify-content-md-end flex-wrap">
108
- <a class="nav-link text-white active" href="{{ page.url | relative_url }}">
109
- <i class="bi bi-house me-1"></i>Home
107
+ {%- include core/i18n.html -%}
108
+ <nav class="nav nav-pills justify-content-md-end flex-wrap" aria-label="{{ ui.news_sections_label | default: 'News sections' }}">
109
+ <a class="nav-link text-white active" href="{{ page.url | relative_url }}" aria-current="page">
110
+ <i class="bi bi-house me-1" aria-hidden="true"></i>Home
110
111
  </a>
111
112
  {% for sec_name in news_sections %}
112
113
  {% assign _sec_nav = site.data.navigation.posts | where: "title", sec_name | first %}
@@ -116,13 +117,13 @@ source: "https://getbootstrap.com/docs/5.3/examples/blog/#"
116
117
  {% capture _sec_url %}{{ news_base }}{{ sec_name | slugify }}/{% endcapture %}
117
118
  {% endif %}
118
119
  <a class="nav-link text-white-50" href="{{ _sec_url | relative_url }}">
119
- {% if _sec_nav.icon %}<i class="bi {{ _sec_nav.icon }} me-1"></i>{% endif %}
120
+ {% if _sec_nav.icon %}<i class="bi {{ _sec_nav.icon }} me-1" aria-hidden="true"></i>{% endif %}
120
121
  {{ sec_name }}
121
122
  </a>
122
123
  {% endfor %}
123
124
  {% if _tags_linkable %}
124
125
  <a class="nav-link text-white-50" href="{{ tags_base | relative_url }}">
125
- <i class="bi bi-tags me-1"></i>Tags
126
+ <i class="bi bi-tags me-1" aria-hidden="true"></i>Tags
126
127
  </a>
127
128
  {% endif %}
128
129
  </nav>
@@ -641,12 +642,12 @@ source: "https://getbootstrap.com/docs/5.3/examples/blog/#"
641
642
  <a href="{{ archives_url | relative_url }}#{{ month.name | slugify }}-{{ year.name }}"
642
643
  class="text-decoration-none">
643
644
  {{ month.name }}
644
- <span class="badge bg-secondary text-body">{{ month.items.size }}</span>
645
+ <span class="badge text-bg-secondary">{{ month.items.size }}</span>
645
646
  </a>
646
647
  {% else %}
647
648
  <span>
648
649
  {{ month.name }}
649
- <span class="badge bg-secondary text-body">{{ month.items.size }}</span>
650
+ <span class="badge text-bg-secondary">{{ month.items.size }}</span>
650
651
  </span>
651
652
  {% endif %}
652
653
  </li>
data/_layouts/note.html CHANGED
@@ -242,12 +242,8 @@ layout: default
242
242
  {% comment %} ================================ {% endcomment %}
243
243
  {% comment %} COMMENTS SECTION {% endcomment %}
244
244
  {% comment %} ================================ {% endcomment %}
245
- {% if page.comments != false and site.giscus.enabled %}
246
- <div class="note-comments mt-5 pt-4 border-top">
247
- <h5 class="mb-4">Comments</h5>
248
- {% include content/giscus.html %}
249
- </div>
250
- {% endif %}
245
+ {% comment %} On unless the page sets comments: false; h5 like the other footer sections. {% endcomment %}
246
+ {% include content/comments.html class="note-comments" compact=true %}
251
247
  {% comment %} ================================ {% endcomment %}
252
248
  {% comment %} BACKLINKS — "Linked mentions" {% endcomment %}
253
249
  {% comment %} ================================ {% endcomment %}
@@ -225,12 +225,8 @@ layout: default
225
225
  {% comment %} ================================ {% endcomment %}
226
226
  {% comment %} COMMENTS SECTION {% endcomment %}
227
227
  {% comment %} ================================ {% endcomment %}
228
- {% if page.comments != false and site.giscus.enabled %}
229
- <div class="notebook-comments mt-5 pt-4 border-top">
230
- <h5 class="mb-4">Comments</h5>
231
- {% include content/giscus.html %}
232
- </div>
233
- {% endif %}
228
+ {% comment %} On unless the page sets comments: false; h5 like the other footer sections. {% endcomment %}
229
+ {% include content/comments.html class="notebook-comments" compact=true %}
234
230
 
235
231
  </article>
236
232
 
data/_layouts/recipe.html CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- # Feature: ZER0-084
2
+ # Features: ZER0-035, ZER0-084
3
3
  layout: default
4
4
  ---
5
5
  {%- comment -%}
@@ -153,12 +153,8 @@ layout: default
153
153
  {% comment %} ================================ {% endcomment %}
154
154
  {% comment %} COMMENTS {% endcomment %}
155
155
  {% comment %} ================================ {% endcomment %}
156
- {%- if page.comments and site.giscus.enabled -%}
157
- <section class="post-comments mt-5 pt-4 border-top" id="comments">
158
- <h2 class="h4 mb-4"><i class="bi bi-chat-dots me-2" aria-hidden="true"></i>Comments</h2>
159
- {%- include content/giscus.html -%}
160
- </section>
161
- {%- endif -%}
156
+ {% comment %} Opt-in: only when the page sets comments: true (and site.giscus.enabled). {% endcomment %}
157
+ {%- include content/comments.html default_on=false -%}
162
158
  </article>
163
159
 
164
160
  {%- comment -%}
data/_layouts/root.html CHANGED
@@ -25,9 +25,7 @@
25
25
  - footer.html: Site footer with links and copyright
26
26
  - js-cdn.html: JavaScript dependencies and custom scripts
27
27
 
28
- Theme: Zer0 Mistakes Jekyll Theme v0.1
29
- Author: Amr Abdel-Motaleb
30
- Copyright: 2024 - it-journey.com | @bamr87
28
+ Theme: jekyll-theme-zer0 (MIT) — https://github.com/bamr87/zer0-mistakes
31
29
  ===================================================================
32
30
  {% endcomment %}
33
31
 
@@ -172,8 +170,13 @@
172
170
  consumer markup renders per page. {% endcomment %}
173
171
  {%- include custom/footer.html -%}
174
172
 
175
- {% comment %} Privacy-compliant cookie consent banner — page-invariant. {% endcomment %}
173
+ {% comment %} Privacy-compliant cookie consent banner — page-invariant. Rendered
174
+ only when the site configures a tracker or forces it with
175
+ cookie_consent.enabled (components/cookie-consent-needed.html, #566). {% endcomment %}
176
+ {%- capture _needs_consent -%}{%- include components/cookie-consent-needed.html -%}{%- endcapture -%}
177
+ {%- if _needs_consent == "true" -%}
176
178
  {%- include_cached components/cookie-consent.html -%}
179
+ {%- endif -%}
177
180
 
178
181
  {% comment %} AI Chat Assistant {% endcomment %}
179
182
  {%- include components/ai-chat.html -%}