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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +131 -0
- data/_data/backlog.yml +97 -28
- data/_data/features.yml +164 -15
- data/_data/navigation/admin.yml +26 -8
- data/_data/navigation/docs.yml +2 -8
- data/_data/theme-manifest.yml +63 -47
- data/_data/ui-text.yml +9 -0
- data/_includes/README.md +2 -1
- data/_includes/components/ai-chat.html +2 -2
- data/_includes/components/author-bio.html +3 -1
- data/_includes/components/author-card.html +9 -9
- data/_includes/components/author-eeat.html +13 -3
- data/_includes/components/collection-manager.html +2 -2
- data/_includes/components/component-showcase.html +7 -7
- data/_includes/components/cookie-consent-needed.html +37 -0
- data/_includes/components/cookie-consent.html +15 -5
- data/_includes/components/page-feedback.html +9 -5
- data/_includes/components/post-card.html +2 -2
- data/_includes/components/theme-customizer.html +1 -1
- data/_includes/content/comments.html +46 -0
- data/_includes/content/giscus.html +22 -13
- data/_includes/content/intro.html +17 -1
- data/_includes/content/jsonld-software.html +4 -9
- data/_includes/core/footer.html +36 -14
- data/_includes/navigation/admin-nav.html +110 -63
- data/_includes/navigation/section-sidebar.html +20 -20
- data/_includes/navigation/sidebar-config.html +17 -8
- data/_includes/navigation/sidebar-right.html +16 -2
- data/_layouts/README.md +1 -1
- data/_layouts/admin.html +49 -20
- data/_layouts/article.html +10 -10
- data/_layouts/book-story.html +3 -7
- data/_layouts/default.html +55 -1
- data/_layouts/news.html +8 -7
- data/_layouts/note.html +2 -6
- data/_layouts/notebook.html +2 -6
- data/_layouts/recipe.html +3 -7
- data/_layouts/root.html +7 -4
- data/_layouts/section.html +43 -42
- data/_sass/components/_page-feedback.scss +1 -1
- data/_sass/components/_ui-enhancements.scss +22 -0
- data/_sass/core/_nav-tree.scss +10 -2
- data/_sass/core/_navbar.scss +19 -5
- data/_sass/core/_obsidian.scss +19 -3
- data/_sass/core/_sidebar-categories.scss +4 -2
- data/_sass/core/_sidebar-extras.scss +3 -2
- data/_sass/layouts/_admin.scss +60 -0
- data/_sass/layouts/_navbar-extras.scss +7 -2
- data/_sass/theme/_skins.scss +124 -32
- data/_sass/tokens/_color.scss +3 -0
- data/_sass/tokens/_layers.scss +12 -5
- data/assets/css/main.scss +1 -0
- data/assets/js/code-copy.js +30 -2
- data/assets/js/setup-wizard.js +2 -2
- data/assets/js/ui-enhancements.js +46 -0
- data/scripts/ai/README.md +1 -1
- data/scripts/bin/audit-consumer +155 -8
- data/scripts/bin/manifest +27 -8
- data/scripts/bin/validate +3 -2
- data/scripts/lib/audit.sh +156 -0
- data/scripts/validate-features.rb +20 -2
- metadata +5 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
===================================================================
|
|
3
|
+
COOKIE CONSENT GATE — does this site need a consent banner?
|
|
4
|
+
===================================================================
|
|
5
|
+
|
|
6
|
+
Path: _includes/components/cookie-consent-needed.html
|
|
7
|
+
Decides whether the cookie-consent banner, its "Manage" modal and the
|
|
8
|
+
footer "Cookie Preferences" button render. Asking consent for cookies a
|
|
9
|
+
site never sets is misleading, so the banner appears only when the build
|
|
10
|
+
configures something that needs consent (#566):
|
|
11
|
+
|
|
12
|
+
- `site.google_analytics` is set (analytics/google-analytics.html)
|
|
13
|
+
- `site.google_tag_manager` is set (analytics/google-tag-manager-head.html)
|
|
14
|
+
- `site.posthog.enabled` is true (analytics/posthog.html)
|
|
15
|
+
|
|
16
|
+
`cookie_consent.enabled` overrides the detection either way: `true` forces
|
|
17
|
+
the banner on (for trackers loaded through custom/ hooks the theme cannot
|
|
18
|
+
see), `false` suppresses it. Unset = auto.
|
|
19
|
+
|
|
20
|
+
An empty string counts as unset: the setup wizard writes
|
|
21
|
+
`google_analytics: ''` for a blank field, and '' is truthy in Liquid.
|
|
22
|
+
|
|
23
|
+
Every input is `site.*`, so callers inside include_cached stay valid.
|
|
24
|
+
|
|
25
|
+
Output is `true` or nothing. Capture it (brace-free so this comment does
|
|
26
|
+
not self-execute):
|
|
27
|
+
capture needs_consent -> include components/cookie-consent-needed.html
|
|
28
|
+
if needs_consent == "true" -> render the banner / button
|
|
29
|
+
===================================================================
|
|
30
|
+
{%- endcomment -%}
|
|
31
|
+
{%- assign _consent = false -%}
|
|
32
|
+
{%- if site.google_analytics and site.google_analytics != "" -%}{%- assign _consent = true -%}{%- endif -%}
|
|
33
|
+
{%- if site.google_tag_manager and site.google_tag_manager != "" -%}{%- assign _consent = true -%}{%- endif -%}
|
|
34
|
+
{%- if site.posthog.enabled == true -%}{%- assign _consent = true -%}{%- endif -%}
|
|
35
|
+
{%- if site.cookie_consent.enabled == true -%}{%- assign _consent = true -%}{%- endif -%}
|
|
36
|
+
{%- if site.cookie_consent.enabled == false -%}{%- assign _consent = false -%}{%- endif -%}
|
|
37
|
+
{%- if _consent -%}true{%- endif -%}
|
|
@@ -120,7 +120,7 @@ Configuration: Uses site.posthog settings from _config.yml
|
|
|
120
120
|
Analytics Cookies
|
|
121
121
|
</h3>
|
|
122
122
|
<div class="form-check form-switch">
|
|
123
|
-
<input class="form-check-input" type="checkbox" id="analyticsCookies"
|
|
123
|
+
<input class="form-check-input" type="checkbox" id="analyticsCookies">
|
|
124
124
|
<label class="form-check-label" for="analyticsCookies">Enable</label>
|
|
125
125
|
</div>
|
|
126
126
|
</div>
|
|
@@ -319,10 +319,15 @@ Configuration: Uses site.posthog settings from _config.yml
|
|
|
319
319
|
setTimeout(finish, 500);
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
// Update modal UI with current preferences
|
|
322
|
+
// Update modal UI with current preferences.
|
|
323
|
+
// Null-safe: this now runs on every first paint (issue #553), including on
|
|
324
|
+
// consumers that override the include and ship the banner without the
|
|
325
|
+
// preferences modal.
|
|
323
326
|
function updateModalUI(consent) {
|
|
324
|
-
document.getElementById('analyticsCookies')
|
|
325
|
-
document.getElementById('marketingCookies')
|
|
327
|
+
const analytics = document.getElementById('analyticsCookies');
|
|
328
|
+
const marketing = document.getElementById('marketingCookies');
|
|
329
|
+
if (analytics) analytics.checked = !!consent.analytics;
|
|
330
|
+
if (marketing) marketing.checked = !!consent.marketing;
|
|
326
331
|
}
|
|
327
332
|
|
|
328
333
|
// Get consent from modal UI
|
|
@@ -340,9 +345,14 @@ Configuration: Uses site.posthog settings from _config.yml
|
|
|
340
345
|
const banner = document.getElementById('cookieConsent');
|
|
341
346
|
const existingConsent = getConsentState();
|
|
342
347
|
|
|
348
|
+
// The switches must reflect the state that is actually in force, which on
|
|
349
|
+
// a first visit is `defaultConsent` (analytics/marketing OFF). Syncing
|
|
350
|
+
// only for returning visitors is what let the markup's own default win
|
|
351
|
+
// and recorded consent the visitor never gave (issue #553).
|
|
352
|
+
updateModalUI(existingConsent || defaultConsent);
|
|
353
|
+
|
|
343
354
|
if (existingConsent) {
|
|
344
355
|
applyConsent(existingConsent);
|
|
345
|
-
updateModalUI(existingConsent);
|
|
346
356
|
// Banner already starts hidden via the `hidden` attribute — nothing to do.
|
|
347
357
|
} else if (banner) {
|
|
348
358
|
showConsentBanner();
|
|
@@ -88,12 +88,16 @@
|
|
|
88
88
|
`position-fixed` is required, not cosmetic: it opts this <body> child out of
|
|
89
89
|
the .zer0-bg-body flattening rule (_sass/theme/_backgrounds.scss) that would
|
|
90
90
|
otherwise force position:relative; z-index:1 and let the cookie banner steal
|
|
91
|
-
the dialog's clicks.
|
|
91
|
+
the dialog's clicks.
|
|
92
|
+
The dialog's header and footer bars are <div>s, not <header>/<footer>: this
|
|
93
|
+
overlay is a <body> child, so those elements became a second `banner` and
|
|
94
|
+
`contentinfo` landmark beside the site's own whenever the dialog was open
|
|
95
|
+
(axe landmark-no-duplicate-banner / -contentinfo / landmark-unique, #593). {% endcomment %}
|
|
92
96
|
<div class="pf-overlay position-fixed" id="pageFeedbackModal" role="dialog" aria-modal="true"
|
|
93
97
|
aria-labelledby="pfTitle" aria-describedby="pfIntro" hidden>
|
|
94
98
|
<div class="pf-dialog shadow-lg" role="document">
|
|
95
99
|
|
|
96
|
-
<
|
|
100
|
+
<div class="pf-header">
|
|
97
101
|
<div class="pf-header-text">
|
|
98
102
|
<h2 id="pfTitle" class="pf-title h5 mb-1">
|
|
99
103
|
<i class="bi bi-megaphone me-2" aria-hidden="true"></i>Share feedback
|
|
@@ -106,7 +110,7 @@
|
|
|
106
110
|
<button type="button" class="pf-close btn btn-sm" id="pfClose" aria-label="Close feedback dialog">
|
|
107
111
|
<i class="bi bi-x-lg" aria-hidden="true"></i>
|
|
108
112
|
</button>
|
|
109
|
-
</
|
|
113
|
+
</div>
|
|
110
114
|
|
|
111
115
|
<form id="pfForm" class="pf-body" novalidate>
|
|
112
116
|
|
|
@@ -248,7 +252,7 @@
|
|
|
248
252
|
|
|
249
253
|
</form>
|
|
250
254
|
|
|
251
|
-
<
|
|
255
|
+
<div class="pf-footer">
|
|
252
256
|
<button type="button" class="btn btn-link btn-sm pf-copy" id="pfCopy">
|
|
253
257
|
<i class="bi bi-clipboard me-1" aria-hidden="true"></i>Copy details
|
|
254
258
|
</button>
|
|
@@ -259,7 +263,7 @@
|
|
|
259
263
|
<span class="pf-submit-label">Open GitHub issue</span>
|
|
260
264
|
</button>
|
|
261
265
|
</div>
|
|
262
|
-
</
|
|
266
|
+
</div>
|
|
263
267
|
|
|
264
268
|
</div>
|
|
265
269
|
</div>
|
|
@@ -190,10 +190,10 @@
|
|
|
190
190
|
{% if include.post.tags.size > 0 %}
|
|
191
191
|
<div class="mt-2">
|
|
192
192
|
{% for tag in include.post.tags limit: 3 %}
|
|
193
|
-
<span class="badge bg-secondary
|
|
193
|
+
<span class="badge text-bg-secondary border me-1">{{ tag }}</span>
|
|
194
194
|
{% endfor %}
|
|
195
195
|
{% if include.post.tags.size > 3 %}
|
|
196
|
-
<span class="badge bg-secondary
|
|
196
|
+
<span class="badge text-bg-secondary border">+{{ include.post.tags.size | minus: 3 }}</span>
|
|
197
197
|
{% endif %}
|
|
198
198
|
</div>
|
|
199
199
|
{% endif %}
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
{% if skin == current_skin %}
|
|
49
49
|
<span class="badge bg-primary"><i class="bi bi-check-circle me-1"></i>Active</span>
|
|
50
50
|
{% else %}
|
|
51
|
-
<small class="text-body-
|
|
51
|
+
<small class="text-body-secondary">Click to preview</small>
|
|
52
52
|
{% endif %}
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{%- comment -%} Feature: ZER0-035 {%- endcomment -%}
|
|
2
|
+
{%- comment -%}
|
|
3
|
+
Component: comments
|
|
4
|
+
Path: _includes/content/comments.html
|
|
5
|
+
Purpose: A page's comment section in one include: the gate, the
|
|
6
|
+
"Comments" heading and the giscus widget (content/giscus.html).
|
|
7
|
+
The article, note, notebook, recipe and book-story layouts all
|
|
8
|
+
render comments through it, so a consumer layout needs one
|
|
9
|
+
include line to show comments the way the theme does.
|
|
10
|
+
Params: default_on (bool, optional, default: true)
|
|
11
|
+
true — shown unless the page sets `comments: false`
|
|
12
|
+
false — shown only when the page sets `comments: true`
|
|
13
|
+
class (string, optional, default: "post-comments")
|
|
14
|
+
the wrapper's own class; the spacing utilities are added
|
|
15
|
+
compact (bool, optional, default: false)
|
|
16
|
+
a div with an h5 heading and no id, the style of the note
|
|
17
|
+
and notebook footer sections; the default is a
|
|
18
|
+
section#comments with an h2 heading
|
|
19
|
+
Depends on: content/giscus.html, site.giscus.enabled, page.comments
|
|
20
|
+
Notes: Renders nothing unless `site.giscus.enabled` is true.
|
|
21
|
+
article, note and notebook keep the default (on unless a page
|
|
22
|
+
opts out); recipe and book-story pass default_on=false (off
|
|
23
|
+
unless a page opts in). The giscus attributes (theme, mapping,
|
|
24
|
+
input position, language) come from the `giscus:` block in
|
|
25
|
+
_config.yml; see content/giscus.html.
|
|
26
|
+
{%- endcomment -%}
|
|
27
|
+
{%- assign _comments_on = false -%}
|
|
28
|
+
{%- if include.default_on == false -%}
|
|
29
|
+
{%- if page.comments -%}{%- assign _comments_on = true -%}{%- endif -%}
|
|
30
|
+
{%- elsif page.comments != false -%}
|
|
31
|
+
{%- assign _comments_on = true -%}
|
|
32
|
+
{%- endif -%}
|
|
33
|
+
{%- if _comments_on and site.giscus.enabled -%}
|
|
34
|
+
{%- assign _comments_class = include.class | default: 'post-comments' -%}
|
|
35
|
+
{%- if include.compact %}
|
|
36
|
+
<div class="{{ _comments_class }} mt-5 pt-4 border-top">
|
|
37
|
+
<h5 class="mb-4">Comments</h5>
|
|
38
|
+
{% include content/giscus.html %}
|
|
39
|
+
</div>
|
|
40
|
+
{%- else %}
|
|
41
|
+
<section class="{{ _comments_class }} mt-5 pt-4 border-top" id="comments">
|
|
42
|
+
<h2 class="h4 mb-4"><i class="bi bi-chat-dots me-2" aria-hidden="true"></i>Comments</h2>
|
|
43
|
+
{% include content/giscus.html %}
|
|
44
|
+
</section>
|
|
45
|
+
{%- endif -%}
|
|
46
|
+
{%- endif -%}
|
|
@@ -6,23 +6,32 @@
|
|
|
6
6
|
Purpose: Embeds the Giscus widget so page comments are stored as
|
|
7
7
|
GitHub Discussions (no database, privacy-friendly).
|
|
8
8
|
Location: _includes/content/giscus.html
|
|
9
|
-
Usage: Rendered by
|
|
10
|
-
`page.comments
|
|
11
|
-
|
|
9
|
+
Usage: Rendered by content/comments.html, which owns the gate
|
|
10
|
+
(`page.comments` and `site.giscus.enabled`), the heading and
|
|
11
|
+
the section for the article / note / notebook / recipe /
|
|
12
|
+
book-story layouts. A layout that wants comments includes
|
|
13
|
+
content/comments.html, not this file. To embed the bare
|
|
14
|
+
widget elsewhere, use the FULL path:
|
|
12
15
|
include content/giscus.html (wrap in Liquid tags)
|
|
13
16
|
Dependencies: site.repository, site.giscus.* (see _config.yml), a public
|
|
14
17
|
repo with Discussions enabled + the Giscus app installed.
|
|
15
18
|
|
|
16
19
|
Features:
|
|
17
20
|
• GitHub Discussions-based commenting
|
|
18
|
-
•
|
|
19
|
-
•
|
|
20
|
-
• Reactions enabled, input positioned at the top
|
|
21
|
+
• Strict title matching for one thread per page (data-strict)
|
|
22
|
+
• Reactions enabled
|
|
21
23
|
|
|
22
24
|
Config-driven attributes (from _config.yml `giscus:` block):
|
|
23
|
-
• data-repo
|
|
24
|
-
• data-repo-id
|
|
25
|
-
• data-category-id
|
|
25
|
+
• data-repo ← site.repository
|
|
26
|
+
• data-repo-id ← site.giscus.data-repo-id
|
|
27
|
+
• data-category-id ← site.giscus.data-category-id
|
|
28
|
+
• data-mapping ← site.giscus.data-mapping (default: pathname)
|
|
29
|
+
• data-input-position ← site.giscus.data-input-position (default: top)
|
|
30
|
+
• data-theme ← site.giscus.data-theme (default: preferred_color_scheme)
|
|
31
|
+
• data-lang ← site.giscus.data-lang (default: en)
|
|
32
|
+
The last four are optional: an unset or blank key keeps the default, so a
|
|
33
|
+
site that sets none of them renders exactly the tag it rendered before
|
|
34
|
+
they existed. Values are passed to giscus as given (HTML-escaped).
|
|
26
35
|
|
|
27
36
|
Docs: pages/_docs/features/giscus-comments.md
|
|
28
37
|
Reference: https://giscus.app/ (Feature Request #FR000001)
|
|
@@ -36,13 +45,13 @@
|
|
|
36
45
|
data-repo="{{ site.repository }}"
|
|
37
46
|
data-repo-id="{{ site.giscus.data-repo-id }}"
|
|
38
47
|
data-category-id="{{ site.giscus.data-category-id }}"
|
|
39
|
-
data-mapping="pathname"
|
|
48
|
+
data-mapping="{{ site.giscus.data-mapping | default: 'pathname' | escape }}"
|
|
40
49
|
data-strict="1"
|
|
41
50
|
data-reactions-enabled="1"
|
|
42
51
|
data-emit-metadata="0"
|
|
43
|
-
data-input-position="top"
|
|
44
|
-
data-theme="preferred_color_scheme"
|
|
45
|
-
data-lang="en"
|
|
52
|
+
data-input-position="{{ site.giscus.data-input-position | default: 'top' | escape }}"
|
|
53
|
+
data-theme="{{ site.giscus.data-theme | default: 'preferred_color_scheme' | escape }}"
|
|
54
|
+
data-lang="{{ site.giscus.data-lang | default: 'en' | escape }}"
|
|
46
55
|
crossorigin="anonymous"
|
|
47
56
|
async>
|
|
48
57
|
</script>
|
|
@@ -139,8 +139,24 @@
|
|
|
139
139
|
{% endfor %}
|
|
140
140
|
{% endif %}
|
|
141
141
|
{% if page.categories contains "docs" %}
|
|
142
|
+
{% comment %} Docs section badge (issue #486). A page whose only category is
|
|
143
|
+
"docs" used to link /docs/docs/, and a category with no section index
|
|
144
|
+
(e.g. "setup") linked a 404. The section root is /docs/ itself, and any
|
|
145
|
+
other section is linked only when a page or doc at that URL is in the
|
|
146
|
+
build; otherwise the badge renders as plain text. {% endcomment %}
|
|
142
147
|
{% assign intro_category_slug = intro_category | append: '' | slugify %}
|
|
143
|
-
{%
|
|
148
|
+
{% if intro_category_slug == "docs" %}
|
|
149
|
+
{% assign intro_docs_section = "/docs/" %}
|
|
150
|
+
{% else %}
|
|
151
|
+
{% assign intro_docs_section = "/docs/" | append: intro_category_slug | append: "/" %}
|
|
152
|
+
{% endif %}
|
|
153
|
+
{% assign intro_docs_index = site.docs | where: "url", intro_docs_section | first %}
|
|
154
|
+
{% unless intro_docs_index %}
|
|
155
|
+
{% assign intro_docs_index = site.html_pages | where: "url", intro_docs_section | first %}
|
|
156
|
+
{% endunless %}
|
|
157
|
+
{% if intro_docs_index %}
|
|
158
|
+
{% capture intro_category_url %}{{ site.baseurl }}{{ intro_docs_section }}{% endcapture %}
|
|
159
|
+
{% endif %}
|
|
144
160
|
{% else %}
|
|
145
161
|
{% assign intro_category_slug = intro_category | append: '' | slugify %}
|
|
146
162
|
{% if intro_tags_linkable %}
|
|
@@ -124,15 +124,10 @@
|
|
|
124
124
|
{
|
|
125
125
|
"@type": "Person",
|
|
126
126
|
"@id": "{{ site.url }}/#author",
|
|
127
|
-
"name": "{{ site.founder | default:
|
|
128
|
-
"alternateName": "
|
|
129
|
-
"url": "https://github.com/
|
|
130
|
-
"sameAs": [
|
|
131
|
-
"https://github.com/bamr87",
|
|
132
|
-
"https://x.com/bamr87"
|
|
133
|
-
],
|
|
134
|
-
"jobTitle": "Software Developer",
|
|
135
|
-
"knowsAbout": ["Jekyll", "Docker", "Bootstrap", "GitHub Pages", "Static Site Generation"]
|
|
127
|
+
"name": "{{ site.founder | default: site.author.name | default: site.title }}"{% if site.github_user %},
|
|
128
|
+
"alternateName": "{{ site.github_user }}",
|
|
129
|
+
"url": "https://github.com/{{ site.github_user }}",
|
|
130
|
+
"sameAs": ["https://github.com/{{ site.github_user }}"]{% endif %}
|
|
136
131
|
}
|
|
137
132
|
]
|
|
138
133
|
}
|
data/_includes/core/footer.html
CHANGED
|
@@ -7,20 +7,25 @@
|
|
|
7
7
|
File: footer.html
|
|
8
8
|
Path: _includes/footer.html
|
|
9
9
|
Purpose: Rich footer inspired by bashconsultants with Powered-by row,
|
|
10
|
-
branding/contact, quick links, social/RSS,
|
|
11
|
-
policy links. Fully responsive with Bootstrap 5 utilities.
|
|
10
|
+
branding/contact, quick links, social/RSS, an opt-in newsletter
|
|
11
|
+
signup, and policy links. Fully responsive with Bootstrap 5 utilities.
|
|
12
12
|
|
|
13
13
|
Template Logic:
|
|
14
14
|
- Top row: "Powered by" credits from site.powered_by
|
|
15
15
|
- Branding block: Site title, optional address/phone/email
|
|
16
16
|
- Quick links: Common pages (adjust as needed)
|
|
17
17
|
- Social links: site.links with icons + RSS feed
|
|
18
|
-
-
|
|
18
|
+
- Newsletter signup: only when a provider endpoint is configured
|
|
19
|
+
(site.newsletter, else site.news.newsletter); the form POSTs the email
|
|
20
|
+
to that endpoint. With none, no form renders and the policy links
|
|
21
|
+
take the whole row
|
|
19
22
|
- Bottom bar: Dynamic copyright year
|
|
20
23
|
|
|
21
24
|
Dependencies:
|
|
22
25
|
- site.powered_by: Framework and service credits
|
|
23
26
|
- site.links: Social media and affiliate links
|
|
27
|
+
- site.newsletter: Newsletter provider (enabled, endpoint, method,
|
|
28
|
+
email_field); falls back to site.news.newsletter
|
|
24
29
|
- site.default_icon: Icon framework (Bootstrap Icons)
|
|
25
30
|
- core/i18n.html: UI strings (per-page language via the `lang` param)
|
|
26
31
|
- Bootstrap 5 classes provided by the theme
|
|
@@ -223,25 +228,38 @@
|
|
|
223
228
|
</div>
|
|
224
229
|
</div>
|
|
225
230
|
|
|
226
|
-
{
|
|
231
|
+
{%- comment -%}
|
|
232
|
+
Middle: newsletter signup + policies. The signup renders only when it
|
|
233
|
+
can work (#554): a provider endpoint from the top-level `newsletter:`
|
|
234
|
+
block, falling back to `news.newsletter:` (the news band's block in
|
|
235
|
+
_layouts/news.html), so one provider lights up both. `enabled: false`
|
|
236
|
+
hides it. A blank endpoint counts as unset, because '' is truthy in
|
|
237
|
+
Liquid. There is deliberately no mailto: fallback here. Without a
|
|
238
|
+
form, the policy links take the whole row.
|
|
239
|
+
{%- endcomment -%}
|
|
240
|
+
{%- assign _footer_nl = site.newsletter | default: site.news.newsletter -%}
|
|
241
|
+
{%- assign _footer_nl_endpoint = _footer_nl.endpoint | strip -%}
|
|
242
|
+
{%- assign _footer_nl_on = false -%}
|
|
243
|
+
{%- assign _footer_policy_cols = "col-12 text-center" -%}
|
|
244
|
+
{%- if _footer_nl_endpoint != "" and _footer_nl.enabled != false -%}
|
|
245
|
+
{%- assign _footer_nl_on = true -%}
|
|
246
|
+
{%- assign _footer_policy_cols = "col-12 col-md-4 col-lg-4 text-md-end text-lg-end" -%}
|
|
247
|
+
{%- endif -%}
|
|
227
248
|
<div class="row mb-3 mb-lg-4 align-items-center justify-content-center g-2 footer-subscribe-row">
|
|
249
|
+
{% if _footer_nl_on %}
|
|
228
250
|
<div class="col-12 col-md-8 col-lg-8">
|
|
229
|
-
<form class="row g-2 footer-subscribe-form" aria-label="Newsletter signup"
|
|
251
|
+
<form class="row g-2 footer-subscribe-form" aria-label="{{ ui.newsletter_label | default: 'Newsletter signup' | escape }}" action="{{ _footer_nl_endpoint | escape }}" method="{{ _footer_nl.method | default: 'post' | escape }}">
|
|
230
252
|
<div class="col-8 col-md-8">
|
|
231
|
-
<label for="footer-email" class="visually-hidden">Email</label>
|
|
232
|
-
<input type="email" name="email" id="footer-email" class="form-control" placeholder="Enter your email" autocomplete="email"
|
|
253
|
+
<label for="footer-email" class="visually-hidden">{{ ui.newsletter_email_label | default: "Email" }}</label>
|
|
254
|
+
<input type="email" name="{{ _footer_nl.email_field | default: 'email' | escape }}" id="footer-email" class="form-control" placeholder="{{ ui.newsletter_placeholder | default: 'Enter your email' | escape }}" autocomplete="email" required>
|
|
233
255
|
</div>
|
|
234
256
|
<div class="col-4 col-md-4">
|
|
235
|
-
<button type="
|
|
236
|
-
</div>
|
|
237
|
-
<div class="col-12">
|
|
238
|
-
{% comment %} The describedby target must stay in the a11y tree at every width (#522); the d-none paragraph is the sighted ≥md duplicate only. {% endcomment %}
|
|
239
|
-
<span id="footer-subscribe-hint" class="visually-hidden">Newsletter is a placeholder until you connect a provider.</span>
|
|
240
|
-
<p class="small text-white-50 mb-0 d-none d-md-block" aria-hidden="true">Newsletter is a placeholder until you connect a provider.</p>
|
|
257
|
+
<button type="submit" class="btn btn-primary w-100">{{ ui.newsletter_subscribe | default: "Subscribe" }}</button>
|
|
241
258
|
</div>
|
|
242
259
|
</form>
|
|
243
260
|
</div>
|
|
244
|
-
|
|
261
|
+
{% endif %}
|
|
262
|
+
<div class="{{ _footer_policy_cols }} footer-policy-links">
|
|
245
263
|
<ul class="list-inline mb-0">
|
|
246
264
|
{% comment %} Only render policy links whose pages exist (or that are explicitly configured). {% endcomment %}
|
|
247
265
|
{% assign _privacy_needle = "|/privacy-policy/|" %}
|
|
@@ -254,11 +272,15 @@
|
|
|
254
272
|
{% if site.terms_of_service_url or footer_page_urls contains _terms_needle or footer_page_urls contains _terms_alt_needle %}
|
|
255
273
|
<li class="list-inline-item"><a href="{{ site.terms_of_service_url | default: '/terms-of-service' | relative_url }}" class="text-light text-decoration-none">Terms of Service</a></li>
|
|
256
274
|
{% endif %}
|
|
275
|
+
{% comment %} Same gate as the banner in root.html: no modal, no button (#566). {% endcomment %}
|
|
276
|
+
{% capture _needs_consent %}{% include components/cookie-consent-needed.html %}{% endcapture %}
|
|
277
|
+
{% if _needs_consent == "true" %}
|
|
257
278
|
<li class="list-inline-item">
|
|
258
279
|
<button type="button" class="footer-inline-button text-light text-decoration-none" data-bs-toggle="modal" data-bs-target="#cookieSettingsModal">
|
|
259
280
|
Cookie Preferences
|
|
260
281
|
</button>
|
|
261
282
|
</li>
|
|
283
|
+
{% endif %}
|
|
262
284
|
</ul>
|
|
263
285
|
</div>
|
|
264
286
|
</div>
|
|
@@ -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
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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
|
-
|
|
26
|
-
{% for item in admin_items %}
|
|
49
|
+
<ul class="nav nav-pills flex-column admin-nav">
|
|
27
50
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
{%
|
|
34
|
-
{%
|
|
35
|
-
|
|
36
|
-
{%
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{%
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
{%
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
{%
|
|
61
|
-
|
|
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
|
-
|
|
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
|
-
|
|
137
|
+
{% endfor %}
|
|
93
138
|
|
|
139
|
+
</ul>
|
|
140
|
+
</li>
|
|
94
141
|
{% endfor %}
|
|
95
142
|
|
|
96
143
|
</ul>
|