jekyll-theme-zer0 1.12.0 → 1.12.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad67d8675eed54308dc843c4f5025aaa20f7fe2b627d517dfaada7522cb68151
4
- data.tar.gz: b1156a1f8b0f70bfbc1ca0299be338c78c989740b8c40c7f249dfee73d161dd5
3
+ metadata.gz: 70cd99cdba3cc1dd7c1d29044ee5cdad162c1670e5516ff0bdd9dfbf3dbcd720
4
+ data.tar.gz: fb3f97db3b77236ff36cca5ff7af267d54484da397f64cb3df03e4b28643b240
5
5
  SHA512:
6
- metadata.gz: 58ec18a1c0e3f222340325fd44677c64798c4bb1e33f4e69f0247fa73f547a4aeabc6dfd81735f98096f01303405f25178a7fbff3e29000e2d31f85720fec4b6
7
- data.tar.gz: 00d341d37e50337fc262ce6055cebfcfe040713bf768c673c7a653045649299c06e95c94e46225c7bfab5b3190817196642f950a956573dae3a8c5056f96b8ed
6
+ metadata.gz: e38c17c29f540bfcfac2328462b6975f07e566ead4dfcf8920cf029ff9a81db95040995686dc61b412abeb24bdc15b1e427aab77e15ee077993a6acfbf7786c3
7
+ data.tar.gz: 2e36c4f5b88e0db3c79277f959f8206e65fa94134f60bd8a6391dd839db8e0f79cbe6aadd4729320d790ac7985630f9f31cdbfc44d83079561a87c7f22ff0e31
data/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.12.1] - 2026-06-10
4
+
5
+ ### Changed
6
+ - Version bump: patch release
7
+
8
+ ### Commits in this release
9
+ - 0c04f703 fix: repair failing test suites, validator crashes, and roadmap/changelog drift (#132)
10
+
11
+
12
+ All notable changes to this project will be documented in this file.
13
+
14
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
15
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
16
+
17
+ ## [Unreleased]
18
+
19
+ ### Fixed
20
+ - **Tooling encoding**: `generate-roadmap.rb`, `sync-backlog.rb`, and `scripts/bin/validate` now read repo files as UTF-8 explicitly, fixing `invalid byte sequence in US-ASCII` crashes in environments without a UTF-8 locale (minimal containers, some CI runners) — `generate-roadmap.sh --check` and `validate --quick` both crashed in such environments
21
+ - **Test suite**: repaired the three test suites that failed on `main`:
22
+ - `scripts/test/integration/auto-version` rewritten against the current release architecture (`scripts/analyze-commits.sh` wrapper, `scripts/utils/analyze-commits`, `scripts/bin/release`, `version-bump.yml`) — it previously targeted the retired `gem-publish.sh`/`auto-version-bump.yml` and aborted under `set -e` due to `((var++))` returning non-zero
23
+ - `scripts/test/integration/mermaid` repointed at `pages/_docs/features/mermaid-diagrams.md` (the doc moved from `pages/_docs/jekyll/`) and at the current Bootstrap-aware theming instead of the removed forest theme/FontAwesome config
24
+ - `_layouts/search.html` given a front matter block so theme layout validation passes
25
+ - **Changelog tooling**: `update_changelog_file` now folds any pending `## [Unreleased]` section into the new release entry and inserts before the first release heading (preserving the file preamble) — stale Unreleased blocks no longer accumulate mid-file; the eight historical stray blocks were folded into the releases that shipped them
26
+
27
+ ### Changed
28
+ - **Roadmap**: advanced to track the shipped gem — v1.9 marked completed, v1.10 (Roadmap Validation) and v1.11 (Continuous-Evolution Loop) recorded, v1.12 (Headless Endpoints) is the active milestone (closes backlog T-001, T-002)
29
+ - **Changelog**: restored the Keep a Changelog preamble at the top of this file
30
+
3
31
  ## [1.12.0] - 2026-06-03
4
32
 
5
33
  ### Changed
@@ -37,9 +65,6 @@
37
65
  ### Commits in this release
38
66
  - 8a5ba7e2 feat(ci): add continuous-evolution backlog loop (#114)
39
67
 
40
-
41
- ## [Unreleased]
42
-
43
68
  ### Added
44
69
  - **Continuous-evolution loop**: a self-sustaining backlog mechanism so AI agents can keep improving the repo between human sessions.
45
70
  - `_data/backlog.yml` — tactical task queue (single source of truth), mirroring the `_data/roadmap.yml` pattern.
@@ -50,6 +75,8 @@
50
75
  - `.github/instructions/backlog.instructions.md` — file-scoped guidance for the backlog.
51
76
  - `docs/systems/continuous-evolution.md` — full design, autonomy policy, and setup.
52
77
  - `CLAUDE.md` — Claude Code pointer to `AGENTS.md` (per the documented convention).
78
+
79
+
53
80
  ## [1.10.0] - 2026-06-01
54
81
 
55
82
  ### Changed
@@ -153,9 +180,6 @@
153
180
  ### Commits in this release
154
181
  - 8a2bd84 feat(install): modular installer with deploy plugins, AI wizard pipeline, scrape v2, and test suite (#111)
155
182
 
156
-
157
- ## [Unreleased]
158
-
159
183
  ### Added
160
184
  - **Modular installer (`scripts/install/`)**: spec-driven, AI-aware installer dispatched by `scripts/bin/install`. Single `.zer0/install.spec.json` contract feeds CLI flags, the TUI wizard, and the OpenAI wizard into one apply pipeline.
161
185
  - **Deploy plugins**: `tasks/deploy_github-pages.sh`, `tasks/deploy_azure-swa.sh`, `tasks/deploy_docker-prod.sh`. Spec deploy targets now auto-render the matching workflow / config from `templates/deploy/`.
@@ -171,17 +195,16 @@
171
195
  - Rewrote `ai/prompts/wizard.system.md` with explicit profile, deploy, and agent heuristics plus a full example output, eliminating empty AI responses.
172
196
  - `plan_load_profile` and `plan_apply_flags` now return `0` explicitly so Bash 3.2 doesn't propagate a trailing-test exit code.
173
197
 
198
+
174
199
  ## [1.8.2] - 2026-05-26
175
200
 
176
201
  ### Changed
177
202
  - Version bump: patch release
178
203
 
179
-
180
- ## [Unreleased]
181
-
182
204
  ### Changed
183
205
  - **Gem packaging**: `jekyll-theme-zer0.gemspec` now excludes `assets/images/` (287 MB of content previews/author photos), `assets/backgrounds/`, `.DS_Store` files, and binary media outside `assets/vendor/`, reducing gem payload to ~8.9 MB
184
206
 
207
+
185
208
  ## [1.8.1] - 2026-05-26
186
209
 
187
210
  ### Changed
@@ -217,9 +240,6 @@
217
240
  ### Commits in this release
218
241
  - 580f2b4 perf: Jekyll build performance improvements + MathJax 3 fix + richer Obsidian cache (#100)
219
242
 
220
-
221
- ## [Unreleased]
222
-
223
243
  ### Added
224
244
  - **Design system & layouts**: Sass token layers (`_sass/tokens/`), component and layout partials (`_sass/components/`, `_sass/layouts/`), skins (`theme_skins.yml` + `_sass/theme/_skins.scss`), utilities, and developer docs (`docs/design-system.md`, `design-tokens.md`, `theming.md`, `layouts-and-navigation.md`, and related guides). Homepage sections are driven by `_data/landing.yml` per `_includes/components/README.md`.
225
245
  - **Navigation & chrome**: Drawer/TOC FAB and sidebar visibility modules (`assets/js/modules/navigation/`), `appearance.js` theme helper, refreshed navbar/footer/breadcrumb markup aligned with Bootstrap 5.3.
@@ -261,6 +281,7 @@
261
281
  ### Fixed (UI)
262
282
  - **Contrast skin — light mode**: The `contrast` skin's `zer0-skin-palette` mixin sets `--bs-link-color: #ffffff` (white accent) which rendered sidebar nav links invisible on a white background in light mode. Added `[data-theme-skin="contrast"]:not([data-bs-theme="dark"])` override in `_sass/theme/_skins.scss` to pin link color to `#111111` in light mode while leaving dark-mode behavior unchanged.
263
283
 
284
+
264
285
  ## [1.6.5] - 2026-05-19
265
286
 
266
287
  ### Changed
@@ -394,9 +415,6 @@
394
415
  - 3d91006 fix(release): replace ((var++)) with var=$((var + 1)) in release path
395
416
  - d33e5e6 feat(intro): refocus Copilot Agent prompts on frontend/CMS workflows (#74)
396
417
 
397
-
398
- ## [Unreleased]
399
-
400
418
  ### Changed
401
419
  - **Docker/Jekyll build performance** — Reduced repeated full-page Liquid scans in the footer, settings offcanvas, and cookie consent includes; cached preview image checks during generation; skipped server-side Obsidian rewrites for documents without Obsidian syntax; and changed Docker dev startup to run `bundle install` only when `bundle check` reports missing dependencies. The profiled Docker build improved from 119.2s to 86.8s in local validation.
402
420
 
@@ -501,6 +519,7 @@
501
519
  `/#setup-wizard`, which is provided by the new welcome layout.
502
520
  - **Version-bump workflow no longer crashes on bash 5.x runners.** `scripts/utils/analyze-commits` (and `scripts/lib/changelog.sh`, `scripts/lib/migrate.sh`) used the `((var++))` post-increment idiom. On bash 5.x, when `var` is 0 the expression evaluates to 0 → exit code 1 → `set -euo pipefail` terminates the script silently. macOS bash 3.2 was more forgiving, so the bug only surfaced in CI. Replaced all release-path sites with `var=$((var + 1))`, which always returns 0. Added a static regression check to the unit tests so the pattern can't return.
503
521
 
522
+
504
523
  ## [1.0.0] - 2026-04-20
505
524
 
506
525
  First stable major release. Consolidates the breaking-change installer rewrite
@@ -573,9 +592,6 @@ See [`docs/installation/migration-from-0.x.md`](docs/installation/migration-from
573
592
  ### Commits in this release
574
593
  - 7f00e4d docs(roadmap): data-driven roadmap with auto-generated README mermaid diagram (#71)
575
594
 
576
-
577
- ## [Unreleased]
578
-
579
595
  ### Changed
580
596
  - **Copilot Agent prompts (`_data/prompts.yml`)**: rewritten to focus on
581
597
  frontend/CMS workflows for the Jekyll theme. Replaced the previous
@@ -625,6 +641,7 @@ See [`docs/installation/migration-from-0.x.md`](docs/installation/migration-from
625
641
  - **Fork cleanup**: `scripts/fork-cleanup.sh` — `posthog`/`giscus` blocks reset only within their own YAML range (no stray matches in unrelated blocks)
626
642
  - **Welcome post**: `templates/pages/welcome-post.md.template` and embedded fallback in `scripts/fork-cleanup.sh` — corrected `layout: journals` → `layout: article` so the generated welcome post builds without “Layout does not exist” warnings on a freshly cleaned fork
627
643
 
644
+
628
645
  ## [0.22.20] - 2026-04-19
629
646
 
630
647
  ### Changed
@@ -766,9 +783,6 @@ See [`docs/installation/migration-from-0.x.md`](docs/installation/migration-from
766
783
  ### Commits in this release
767
784
  - a70ae8a chore: consolidate configuration, dependencies, and installation (PRs #48, #51, #52, #53) (#51)
768
785
 
769
-
770
- ## [Unreleased] — Universal Installer
771
-
772
786
  ### Added
773
787
  - **Installer**: New `--remote` install mode — forks repo and creates an orphan `gh-pages` branch with only the bare minimum files needed to render via `remote_theme` (no local theme source)
774
788
  - **Installer**: New `--github` install mode — interactive fork via `gh` CLI with automatic platform detection and setup
@@ -793,6 +807,7 @@ See [`docs/installation/migration-from-0.x.md`](docs/installation/migration-from
793
807
  - **Templates**: `configuration.md.template` — comprehensive rewrite with URL tables, all config sections, cookie consent, dev config
794
808
  - **Templates**: `welcome-post.md.template` — enhanced Day 1 tutorial with folder structure diagram, commands table, feature checklist
795
809
 
810
+
796
811
  ## [0.22.6] - 2026-04-03
797
812
 
798
813
  ### Changed
@@ -2376,13 +2391,6 @@ See [`docs/installation/migration-from-0.x.md`](docs/installation/migration-from
2376
2391
  - Initial plan
2377
2392
  - Initial plan
2378
2393
 
2379
- All notable changes to this project will be documented in this file.
2380
-
2381
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2382
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
2383
-
2384
- ## [Unreleased]
2385
-
2386
2394
  ### Added
2387
2395
 
2388
2396
  - Comprehensive documentation organization system in `/docs/` directory
@@ -2394,6 +2402,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2394
2402
  - Migrated scattered documentation files to organized structure
2395
2403
  - Improved documentation discoverability and maintenance
2396
2404
 
2405
+
2397
2406
  ## [0.5.0] - 2025-10-25
2398
2407
 
2399
2408
  ### Added
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  title: zer0-mistakes
3
3
  sub-title: AI-Native Jekyll Theme
4
4
  description: AI-native Jekyll theme for GitHub Pages — Docker-first development, AI-powered installation, multi-agent integration (Copilot, Codex, Cursor, Claude), AI preview-image generation, and AIEO content optimization with Bootstrap 5.3.
5
- version: 1.12.0
5
+ version: 1.12.1
6
6
  layout: landing
7
7
  tags:
8
8
  - jekyll
@@ -20,7 +20,7 @@ categories:
20
20
  - bootstrap
21
21
  - ai-tooling
22
22
  created: 2024-02-10T23:51:11.480Z
23
- lastmod: 2026-06-03T01:23:07.000Z
23
+ lastmod: 2026-06-10T22:03:08.000Z
24
24
  draft: false
25
25
  permalink: /
26
26
  slug: zer0
@@ -827,8 +827,11 @@ gantt
827
827
  v1.6 About Page & Search Cleanup :done, 2026-04, 2026-04
828
828
  v1.7 Build Performance & MathJax 3 :done, 2026-05, 2026-05
829
829
  v1.8 Design Tokens & Navigation Chrome :done, 2026-05, 2026-05
830
+ v1.9 Installer v2 & Site Scraper :done, 2026-05, 2026-05
831
+ v1.10 Roadmap Validation :done, 2026-06, 2026-06
832
+ v1.11 Continuous-Evolution Loop :done, 2026-06, 2026-06
830
833
  section Current
831
- v1.9 Installer v2 & Site Scraper :active, 2026-05, 2026-05
834
+ v1.12 Headless Endpoints :active, 2026-06, 2026-06
832
835
  section Future
833
836
  v2.0 CMS Integration :2026-06, 2026-08
834
837
  v2.1 i18n Support :2026-08, 2026-10
@@ -857,7 +860,10 @@ gantt
857
860
  | **v1.6** | ✅ Completed | Apr 2026 | Expanded About page and removal of the Algolia search dependency. |
858
861
  | **v1.7** | ✅ Completed | May 2026 | Significant Jekyll build speedups and a MathJax 3 inline-math fix. |
859
862
  | **v1.8** | ✅ Completed | May 2026 | Sass design-token system, refreshed navigation chrome, and a docs overhaul. |
860
- | **v1.9** | 🚧 In Progress | Current (1.9.x) | Modular installer v2 with deploy plugins, AI wizard pipeline, and a site scraper. |
863
+ | **v1.9** | Completed | May 2026 | Modular installer v2 with deploy plugins, AI wizard pipeline, and a site scraper. |
864
+ | **v1.10** | ✅ Completed | Jun 2026 | Roadmap integrity validation and catch-up milestones so the roadmap tracks the shipped gem. |
865
+ | **v1.11** | ✅ Completed | Jun 2026 | Self-sustaining backlog loop so AI agents keep improving the repo between human sessions. |
866
+ | **v1.12** | 🚧 In Progress | Current (1.12.x) | Machine-readable site endpoints for downstream sites and AI agents. |
861
867
  | **v2.0** | 🗓 Planned | Q3 2026 | Headless CMS integration with a content API and admin dashboard. |
862
868
  | **v2.1** | 🗓 Planned | Q4 2026 | Multi-language content support with locale-aware routing. |
863
869
  | **v2.2** | 🗓 Planned | Q4 2026 | Visual theme customizer, A/B testing, and conversion funnels. |
@@ -901,7 +907,7 @@ git push origin feature/awesome-feature
901
907
 
902
908
  | Metric | Value |
903
909
  |--------|-------|
904
- | **Current Version** | 1.12.0 ([RubyGems](https://rubygems.org/gems/jekyll-theme-zer0), [CHANGELOG](/CHANGELOG)) |
910
+ | **Current Version** | 1.12.1 ([RubyGems](https://rubygems.org/gems/jekyll-theme-zer0), [CHANGELOG](/CHANGELOG)) |
905
911
  | **Documented Features** | 43 ([Feature Registry](https://github.com/bamr87/zer0-mistakes/blob/main/_data/features.yml)) |
906
912
  | **Setup Time** | 2-5 minutes ([install.sh benchmarks](https://github.com/bamr87/zer0-mistakes/blob/main/install.sh)) |
907
913
  | **Documentation Pages** | 70+ ([browse docs](https://zer0-mistakes.com/pages/)) |
@@ -956,6 +962,6 @@ And these AI partners that make zer0-mistakes truly AI-native:
956
962
 
957
963
  **Built with ❤️ — and a little help from our AI partners — for the Jekyll community**
958
964
 
959
- **v1.12.0** • [Changelog](CHANGELOG.md) • [License](LICENSE) • [Contributing](CONTRIBUTING.md) • [AI Agent Guide](AGENTS.md)
965
+ **v1.12.1** • [Changelog](CHANGELOG.md) • [License](LICENSE) • [Contributing](CONTRIBUTING.md) • [AI Agent Guide](AGENTS.md)
960
966
 
961
967
 
data/_data/backlog.yml CHANGED
@@ -55,7 +55,7 @@
55
55
 
56
56
  meta:
57
57
  title: "zer0-mistakes Backlog"
58
- updated: 2026-06-01
58
+ updated: 2026-06-10
59
59
  next_id: 12
60
60
 
61
61
  tasks:
@@ -63,7 +63,7 @@ tasks:
63
63
 
64
64
  - id: T-001
65
65
  title: "Reconcile roadmap milestone numbering with the published gem version"
66
- status: open
66
+ status: done
67
67
  priority: P2
68
68
  area: docs
69
69
  risk: standard
@@ -73,17 +73,19 @@ tasks:
73
73
  `_data/roadmap.yml` milestones run 0.17–1.0 while the gem ships as 1.9.9.
74
74
  Decide on a single numbering scheme (or document the mapping) so the
75
75
  roadmap, README, and RubyGems version no longer contradict each other.
76
+ Done 2026-06-10: roadmap advanced to track the shipped gem — v1.9
77
+ completed, v1.10/v1.11 recorded, v1.12 active.
76
78
  acceptance:
77
79
  - "Roadmap version line and gem version no longer contradict (either remapped or an explicit mapping note added to `_data/roadmap.yml` and `pages/roadmap.md`)."
78
80
  - "`./scripts/generate-roadmap.sh --check` passes after the change."
79
81
  - "No edit to `lib/jekyll-theme-zer0/version.rb`."
80
82
  links: { issue: null, pr: null, roadmap: null }
81
83
  created: 2026-05-31
82
- updated: 2026-05-31
84
+ updated: 2026-06-10
83
85
 
84
86
  - id: T-002
85
87
  title: "Refresh roadmap `updated:` date and review milestone statuses"
86
- status: open
88
+ status: done
87
89
  priority: P3
88
90
  area: docs
89
91
  risk: low
@@ -92,13 +94,15 @@ tasks:
92
94
  summary: >-
93
95
  `_data/roadmap.yml` `meta.updated` is 2026-04-18. Refresh it and confirm
94
96
  the 0.22 "active" milestone still reflects reality.
97
+ Done 2026-06-10: `meta.updated` refreshed and statuses reconciled with
98
+ shipped releases through v1.12.0.
95
99
  acceptance:
96
100
  - "`meta.updated` set to the current date."
97
101
  - "Active/planned statuses reviewed against shipped work."
98
102
  - "`./scripts/generate-roadmap.sh --check` passes."
99
103
  links: { issue: null, pr: null, roadmap: null }
100
104
  created: 2026-05-31
101
- updated: 2026-05-31
105
+ updated: 2026-06-10
102
106
 
103
107
  - id: T-003
104
108
  title: "Add GitHub issue templates and a pull-request template"
data/_data/roadmap.yml CHANGED
@@ -60,7 +60,7 @@
60
60
  meta:
61
61
  title: "zer0-mistakes Roadmap"
62
62
  tagline: "Past releases, current focus, and future plans for the zer0-mistakes Jekyll theme."
63
- updated: 2026-05-30
63
+ updated: 2026-06-10
64
64
 
65
65
  milestones:
66
66
  # --- Completed -------------------------------------------------------------
@@ -270,15 +270,12 @@ milestones:
270
270
  - "Unified Playwright test tiers (smoke / snapshots / regression)"
271
271
  - "Design-system developer docs"
272
272
 
273
- # --- Current ---------------------------------------------------------------
274
-
275
273
  - version: "1.9"
276
274
  title: "Installer v2 & Site Scraper"
277
- status: active
278
- section: Current
275
+ status: completed
276
+ section: Completed
279
277
  start: 2026-05
280
278
  end: 2026-05
281
- target: "Current (1.9.x)"
282
279
  released: 2026-05-27
283
280
  summary: "Modular installer v2 with deploy plugins, AI wizard pipeline, and a site scraper."
284
281
  features:
@@ -288,6 +285,49 @@ milestones:
288
285
  - "Quickstart documentation rewrite with screenshots"
289
286
  - "Hardened one-line installer path"
290
287
 
288
+ - version: "1.10"
289
+ title: "Roadmap Validation"
290
+ status: completed
291
+ section: Completed
292
+ start: 2026-06
293
+ end: 2026-06
294
+ released: 2026-06-01
295
+ summary: "Roadmap integrity validation and catch-up milestones so the roadmap tracks the shipped gem."
296
+ features:
297
+ - "`generate-roadmap.rb --validate` mode (status/section/version/date checks)"
298
+ - "Catch-up milestones v1.0–1.9 recorded in the roadmap"
299
+ - "README roadmap accuracy fixes"
300
+
301
+ - version: "1.11"
302
+ title: "Continuous-Evolution Loop"
303
+ status: completed
304
+ section: Completed
305
+ start: 2026-06
306
+ end: 2026-06
307
+ released: 2026-06-01
308
+ summary: "Self-sustaining backlog loop so AI agents keep improving the repo between human sessions."
309
+ features:
310
+ - "`_data/backlog.yml` tactical task queue (single source of truth)"
311
+ - "Backlog ↔ GitHub Issues sync workflow with schema validation"
312
+ - "Auto-merge for low-risk (docs/deps/lint) PRs once CI is green"
313
+ - "`/repo-audit` and `/backlog-implement` agent routines"
314
+ - "Documentation maintenance system and consolidation"
315
+
316
+ # --- Current ---------------------------------------------------------------
317
+
318
+ - version: "1.12"
319
+ title: "Headless Endpoints"
320
+ status: active
321
+ section: Current
322
+ start: 2026-06
323
+ end: 2026-06
324
+ target: "Current (1.12.x)"
325
+ summary: "Machine-readable site endpoints for downstream sites and AI agents."
326
+ features:
327
+ - "Auto-generated `/search.json` endpoint for downstream sites"
328
+ - "Auto-generated `/sitemap/` endpoint"
329
+ - "Ruby gem and Mermaid dependency updates"
330
+
291
331
  # --- Future ----------------------------------------------------------------
292
332
 
293
333
  - version: "2.0"
@@ -27,7 +27,7 @@
27
27
 
28
28
  Configuration:
29
29
  - Mermaid v10 bundled locally (_config.yml mermaid.src)
30
- - Forest theme for dark mode compatibility
30
+ - Adaptive light/dark theme following Bootstrap's data-bs-theme
31
31
  - Client-side code block conversion for GitHub Pages compatibility
32
32
 
33
33
  GitHub Pages Compatibility:
data/_layouts/search.html CHANGED
@@ -1 +1,6 @@
1
+ ---
2
+ # Bare layout that renders the client-side search index as pure JSON.
3
+ # Used by /search.json (see search.json in the site root); downstream
4
+ # sites get the endpoint automatically via the theme gem.
5
+ ---
1
6
  {% include search-data.json %}
data/scripts/bin/validate CHANGED
@@ -236,7 +236,9 @@ versions = {
236
236
  }
237
237
 
238
238
  if File.file?('package.json')
239
- versions['package.json'] = JSON.parse(File.read('package.json')).fetch('version').to_s
239
+ # Explicit UTF-8: package.json contains multibyte characters and the default
240
+ # external encoding is US-ASCII when no locale is set (containers, some CI).
241
+ versions['package.json'] = JSON.parse(File.read('package.json', encoding: 'UTF-8')).fetch('version').to_s
240
242
  end
241
243
 
242
244
  expected = versions.values.first
@@ -149,7 +149,7 @@ end
149
149
  def current_gem_version
150
150
  return nil unless File.exist?(VERSION_RB)
151
151
 
152
- m = File.read(VERSION_RB).match(/VERSION\s*=\s*["']([^"']+)["']/)
152
+ m = File.read(VERSION_RB, encoding: 'UTF-8').match(/VERSION\s*=\s*["']([^"']+)["']/)
153
153
  m && m[1]
154
154
  end
155
155
 
@@ -318,7 +318,7 @@ def main
318
318
  begin
319
319
  YAML.load_file(DATA_FILE, permitted_classes: [Date, Time])
320
320
  rescue ArgumentError
321
- YAML.safe_load(File.read(DATA_FILE), permitted_classes: [Date, Time], aliases: false)
321
+ YAML.safe_load(File.read(DATA_FILE, encoding: 'UTF-8'), permitted_classes: [Date, Time], aliases: false)
322
322
  end
323
323
 
324
324
  return run_validation(data) if options[:mode] == :validate
@@ -333,7 +333,9 @@ def main
333
333
  return 0
334
334
  end
335
335
 
336
- original = File.read(README)
336
+ # Force UTF-8: the README contains emoji, and the default external encoding
337
+ # is US-ASCII when no locale is set (minimal containers, some CI runners).
338
+ original = File.read(README, encoding: 'UTF-8')
337
339
  updated = original.dup
338
340
  updated = replace_block(updated, MERMAID_START, MERMAID_END, mermaid)
339
341
  updated = replace_block(updated, TABLE_START, TABLE_END, table)
@@ -305,18 +305,59 @@ update_changelog_file() {
305
305
 
306
306
  # Create backup
307
307
  cp "$CHANGELOG_FILE" "${CHANGELOG_FILE}.bak"
308
-
309
- # Insert new entry after header (preserve first line)
308
+
309
+ # Fold any pending "## [Unreleased]" section into the new entry so its
310
+ # notes ship with this release instead of getting buried beneath it
311
+ # (stale Unreleased blocks used to accumulate mid-file).
312
+ local unreleased_start
313
+ unreleased_start=$(grep -n '^## \[Unreleased\]' "$CHANGELOG_FILE" | head -1 | cut -d: -f1)
314
+
315
+ if [[ -n "$unreleased_start" ]]; then
316
+ # First "## " heading after the Unreleased one (relative offset)
317
+ local rel_next
318
+ rel_next=$(tail -n +"$((unreleased_start + 1))" "$CHANGELOG_FILE" | grep -n '^## ' | head -1 | cut -d: -f1)
319
+
320
+ local unreleased_body
321
+ if [[ -n "$rel_next" ]]; then
322
+ unreleased_body=$(sed -n "$((unreleased_start + 1)),$((unreleased_start + rel_next - 1))p" "$CHANGELOG_FILE")
323
+ else
324
+ unreleased_body=$(tail -n +"$((unreleased_start + 1))" "$CHANGELOG_FILE")
325
+ fi
326
+
327
+ # Drop the Unreleased section (header + body) from the file
328
+ {
329
+ head -n "$((unreleased_start - 1))" "$CHANGELOG_FILE"
330
+ [[ -n "$rel_next" ]] && tail -n +"$((unreleased_start + rel_next))" "$CHANGELOG_FILE"
331
+ } > "${CHANGELOG_FILE}.tmp"
332
+ mv "${CHANGELOG_FILE}.tmp" "$CHANGELOG_FILE"
333
+
334
+ # Append the pending notes to the new entry (if any are non-blank)
335
+ if [[ -n "${unreleased_body//[[:space:]]/}" ]]; then
336
+ debug "Folding pending [Unreleased] notes into the new entry"
337
+ entry+=$'\n'"$(echo "$unreleased_body" | sed -e '/./,$!d')"$'\n'
338
+ fi
339
+ fi
340
+
341
+ # Insert the new entry before the first release heading so the file
342
+ # header/preamble (title, Keep a Changelog blurb) stays at the top.
343
+ local first_release
344
+ first_release=$(grep -n '^## ' "$CHANGELOG_FILE" | head -1 | cut -d: -f1)
345
+
310
346
  {
311
- head -n 1 "$CHANGELOG_FILE"
312
- echo ""
313
- echo "$entry"
314
- tail -n +2 "$CHANGELOG_FILE"
347
+ if [[ -n "$first_release" ]]; then
348
+ head -n "$((first_release - 1))" "$CHANGELOG_FILE"
349
+ echo "$entry"
350
+ tail -n +"$first_release" "$CHANGELOG_FILE"
351
+ else
352
+ cat "$CHANGELOG_FILE"
353
+ echo ""
354
+ echo "$entry"
355
+ fi
315
356
  } > "${CHANGELOG_FILE}.tmp"
316
-
357
+
317
358
  mv "${CHANGELOG_FILE}.tmp" "$CHANGELOG_FILE"
318
359
  rm -f "${CHANGELOG_FILE}.bak"
319
-
360
+
320
361
  debug "✓ Updated $CHANGELOG_FILE"
321
362
  }
322
363
 
@@ -78,7 +78,7 @@ def load_data
78
78
  begin
79
79
  YAML.load_file(DATA_FILE, permitted_classes: [Date, Time])
80
80
  rescue ArgumentError
81
- YAML.safe_load(File.read(DATA_FILE), permitted_classes: [Date, Time], aliases: false)
81
+ YAML.safe_load(File.read(DATA_FILE, encoding: 'UTF-8'), permitted_classes: [Date, Time], aliases: false)
82
82
  end
83
83
  end
84
84
 
@@ -21,6 +21,13 @@ log_warning() { warn "$@"; }
21
21
  log_error() { error "$@"; }
22
22
  log_test() { step "$@"; }
23
23
 
24
+ # Paths under test (the workflow calls the wrapper; the implementation
25
+ # lives in scripts/utils/; releases go through scripts/bin/release)
26
+ ANALYZE_WRAPPER="$SCRIPTS_ROOT/analyze-commits.sh"
27
+ ANALYZE_IMPL="$SCRIPTS_ROOT/utils/analyze-commits"
28
+ RELEASE_BIN="$SCRIPTS_ROOT/bin/release"
29
+ WORKFLOW_FILE="$PROJECT_ROOT/.github/workflows/version-bump.yml"
30
+
24
31
  # Test counter
25
32
  TESTS_RUN=0
26
33
  TESTS_PASSED=0
@@ -29,49 +36,64 @@ run_test() {
29
36
  local test_name="$1"
30
37
  local test_command="$2"
31
38
  local expected_result="${3:-}"
32
-
33
- ((TESTS_RUN++))
39
+
40
+ # Plain arithmetic assignment: ((VAR++)) returns the pre-increment value,
41
+ # which is non-zero-exit when 0 and aborts the script under `set -e`.
42
+ TESTS_RUN=$((TESTS_RUN + 1))
34
43
  log_test "Running: $test_name"
35
-
44
+
36
45
  local actual_result
37
46
  if actual_result=$(eval "$test_command" 2>&1); then
38
47
  if [[ -n "$expected_result" ]]; then
39
48
  if [[ "$actual_result" == "$expected_result" ]]; then
40
49
  log_success "✅ $test_name"
41
- ((TESTS_PASSED++))
50
+ TESTS_PASSED=$((TESTS_PASSED + 1))
42
51
  else
43
52
  log_error "❌ $test_name - Expected: '$expected_result', Got: '$actual_result'"
44
53
  fi
45
54
  else
46
55
  log_success "✅ $test_name"
47
- ((TESTS_PASSED++))
56
+ TESTS_PASSED=$((TESTS_PASSED + 1))
48
57
  fi
49
58
  else
50
59
  log_error "❌ $test_name - Command failed: $actual_result"
51
60
  fi
52
61
  }
53
62
 
63
+ # Test file permissions and executability
64
+ test_file_permissions() {
65
+ log_info "Testing file permissions..."
66
+
67
+ local scripts=(
68
+ "$ANALYZE_WRAPPER"
69
+ "$ANALYZE_IMPL"
70
+ "$RELEASE_BIN"
71
+ )
72
+
73
+ for script in "${scripts[@]}"; do
74
+ local script_name=$(basename "$script")
75
+ run_test "$script_name is executable" "test -x '$script'"
76
+ done
77
+ }
78
+
54
79
  # Test the commit analysis script
55
80
  test_commit_analysis() {
56
81
  log_info "Testing commit analysis functionality..."
57
-
58
- # Test script exists and is executable
59
- run_test "Commit analysis script exists" "test -x '$SCRIPT_DIR/analyze-commits.sh'"
60
-
82
+
61
83
  # Test help output
62
- run_test "Help output works" "$SCRIPT_DIR/analyze-commits.sh --help | grep -q 'Commit Analysis Script'"
63
-
84
+ run_test "Help output works" "$ANALYZE_IMPL --help | grep -q 'Commit Analysis Script'"
85
+
64
86
  # Test with sample commit ranges (if we have git history)
65
87
  if git rev-list --count HEAD >/dev/null 2>&1; then
66
88
  local commit_count=$(git rev-list --count HEAD)
67
-
89
+
68
90
  if [[ $commit_count -gt 1 ]]; then
69
- # Test analyzing last commit
70
- run_test "Analyze last commit" "$SCRIPT_DIR/analyze-commits.sh HEAD~1..HEAD | grep -E '^(patch|minor|major|none)$'"
71
-
91
+ # Test analyzing last commit (through the wrapper, like the workflow)
92
+ run_test "Analyze last commit" "$ANALYZE_WRAPPER HEAD~1..HEAD | grep -E '^(patch|minor|major|none)$'"
93
+
72
94
  # Test analyzing multiple commits if available
73
95
  if [[ $commit_count -gt 3 ]]; then
74
- run_test "Analyze multiple commits" "$SCRIPT_DIR/analyze-commits.sh HEAD~3..HEAD | grep -E '^(patch|minor|major|none)$'"
96
+ run_test "Analyze multiple commits" "$ANALYZE_WRAPPER HEAD~3..HEAD | grep -E '^(patch|minor|major|none)$'"
75
97
  fi
76
98
  fi
77
99
  else
@@ -79,102 +101,51 @@ test_commit_analysis() {
79
101
  fi
80
102
  }
81
103
 
82
- # Test gem publication script compatibility
83
- test_gem_publish_script() {
84
- log_info "Testing gem publication script compatibility..."
85
-
86
- # Test script exists and is executable
87
- run_test "Gem publish script exists" "test -x '$SCRIPT_DIR/gem-publish.sh'"
88
-
89
- # Test new automated options
90
- run_test "Automated release option works" "$SCRIPT_DIR/gem-publish.sh --help | grep -q 'automated-release'"
91
- run_test "Auto commit range option works" "$SCRIPT_DIR/gem-publish.sh --help | grep -q 'auto-commit-range'"
92
-
93
- # Test dry run with automated options
94
- if [[ -f "$PROJECT_ROOT/lib/jekyll-theme-zer0/version.rb" ]]; then
95
- run_test "Dry run with automated options" "$SCRIPT_DIR/gem-publish.sh patch --dry-run --automated-release --skip-tests --skip-publish --no-github-release | grep -q 'Automated Release Mode'"
96
- fi
104
+ # Test release command compatibility (replaces the retired gem-publish.sh)
105
+ test_release_command() {
106
+ log_info "Testing release command compatibility..."
107
+
108
+ run_test "Release help works" "$RELEASE_BIN --help | grep -q 'VERSION TYPES'"
109
+ run_test "Dry-run option documented" "$RELEASE_BIN --help | grep -q -- '--dry-run'"
110
+ run_test "Skip-publish option documented" "$RELEASE_BIN --help | grep -q -- '--skip-publish'"
97
111
  }
98
112
 
99
113
  # Test workflow files syntax
100
114
  test_workflow_syntax() {
101
115
  log_info "Testing GitHub Actions workflow syntax..."
102
-
116
+
117
+ run_test "version-bump workflow exists" "test -f '$WORKFLOW_FILE'"
118
+
103
119
  # Check if yamllint is available
104
120
  if command -v yamllint >/dev/null 2>&1; then
105
- run_test "Auto-version-bump workflow syntax" "yamllint '$PROJECT_ROOT/.github/workflows/auto-version-bump.yml'"
121
+ run_test "version-bump workflow syntax" "yamllint -c '$PROJECT_ROOT/.github/config/.yamllint.yml' '$WORKFLOW_FILE'"
106
122
  else
107
- # Basic YAML syntax check with Python
108
- if command -v python3 >/dev/null 2>&1; then
109
- run_test "Auto-version-bump workflow syntax" "python3 -c 'import yaml; yaml.safe_load(open(\"$PROJECT_ROOT/.github/workflows/auto-version-bump.yml\"))'"
110
- else
111
- log_warning "Neither yamllint nor python3 available for YAML validation"
112
- fi
123
+ # Basic YAML syntax check with Ruby (always present for this repo)
124
+ run_test "version-bump workflow syntax" "ruby -ryaml -e 'YAML.safe_load_file(\"$WORKFLOW_FILE\", aliases: true)'"
113
125
  fi
114
126
  }
115
127
 
116
- # Test file permissions and executability
117
- test_file_permissions() {
118
- log_info "Testing file permissions..."
119
-
120
- local scripts=(
121
- "$SCRIPT_DIR/analyze-commits.sh"
122
- "$SCRIPT_DIR/gem-publish.sh"
123
- )
124
-
125
- for script in "${scripts[@]}"; do
126
- local script_name=$(basename "$script")
127
- run_test "$script_name is executable" "test -x '$script'"
128
- done
129
- }
130
-
131
128
  # Test integration between components
132
129
  test_integration() {
133
130
  log_info "Testing integration between components..."
134
-
135
- # Test that analyze-commits.sh can be called by the workflow
136
- if [[ -x "$SCRIPT_DIR/analyze-commits.sh" ]]; then
137
- # Test with a simple commit range
138
- if git rev-list --count HEAD >/dev/null 2>&1; then
139
- local commit_count=$(git rev-list --count HEAD)
140
- if [[ $commit_count -gt 0 ]]; then
141
- run_test "Integration: commit analysis returns valid output" "$SCRIPT_DIR/analyze-commits.sh HEAD~1..HEAD | grep -E '^(patch|minor|major|none)$'"
142
- fi
131
+
132
+ # The workflow invokes ./scripts/analyze-commits.sh and validates its output
133
+ if git rev-list --count HEAD >/dev/null 2>&1; then
134
+ local commit_count=$(git rev-list --count HEAD)
135
+ if [[ $commit_count -gt 0 ]]; then
136
+ run_test "Integration: commit analysis returns valid output" "$ANALYZE_WRAPPER HEAD~1..HEAD | grep -E '^(patch|minor|major|none)$'"
143
137
  fi
144
138
  fi
145
-
146
- # Test that gem-publish.sh accepts the new parameters
147
- if [[ -x "$SCRIPT_DIR/gem-publish.sh" ]]; then
148
- run_test "Integration: gem-publish accepts automated params" "$SCRIPT_DIR/gem-publish.sh patch --dry-run --automated-release --auto-commit-range=HEAD~1..HEAD --skip-tests --skip-publish --no-github-release | grep -q 'DRY RUN MODE'"
149
- fi
150
139
  }
151
140
 
152
141
  # Test conventional commit detection
153
142
  test_conventional_commits() {
154
143
  log_info "Testing conventional commit detection..."
155
-
156
- # Create test commits in memory (don't actually commit)
157
- local test_commits=(
158
- "feat: add new feature"
159
- "fix: resolve bug in component"
160
- "BREAKING CHANGE: remove deprecated API"
161
- "chore: update dependencies"
162
- "docs: improve documentation"
163
- )
164
-
165
- local expected_results=(
166
- "minor"
167
- "patch"
168
- "major"
169
- "patch"
170
- "patch"
171
- )
172
-
173
- # Note: This would require a more sophisticated test setup
174
- # For now, just test that the patterns exist in the script
175
- run_test "Conventional commit patterns exist" "grep -q 'feat.*minor' '$SCRIPT_DIR/analyze-commits.sh'"
176
- run_test "Fix patterns exist" "grep -q 'fix.*patch' '$SCRIPT_DIR/analyze-commits.sh'"
177
- run_test "Breaking change patterns exist" "grep -q 'BREAKING.*major' '$SCRIPT_DIR/analyze-commits.sh'"
144
+
145
+ # Test that the documented mapping exists in the analyzer
146
+ run_test "Conventional commit patterns exist" "grep -q 'feat.*minor' '$ANALYZE_IMPL'"
147
+ run_test "Fix patterns exist" "grep -q 'fix.*patch' '$ANALYZE_IMPL'"
148
+ run_test "Breaking change patterns exist" "grep -q 'BREAKING.*major' '$ANALYZE_IMPL'"
178
149
  }
179
150
 
180
151
  # Main test execution
@@ -182,18 +153,18 @@ main() {
182
153
  log_info "🧪 Starting Automated Version Bump System Tests"
183
154
  echo "=================================================="
184
155
  echo ""
185
-
156
+
186
157
  # Change to project root
187
158
  cd "$PROJECT_ROOT"
188
-
159
+
189
160
  # Run all test suites
190
161
  test_file_permissions
191
162
  test_commit_analysis
192
- test_gem_publish_script
163
+ test_release_command
193
164
  test_workflow_syntax
194
165
  test_integration
195
166
  test_conventional_commits
196
-
167
+
197
168
  # Test summary
198
169
  echo ""
199
170
  echo "=================================================="
@@ -201,7 +172,7 @@ main() {
201
172
  echo "Tests Run: $TESTS_RUN"
202
173
  echo "Tests Passed: $TESTS_PASSED"
203
174
  echo "Tests Failed: $((TESTS_RUN - TESTS_PASSED))"
204
-
175
+
205
176
  if [[ $TESTS_PASSED -eq $TESTS_RUN ]]; then
206
177
  log_success "🎉 All tests passed! Automated version bump system is ready."
207
178
  exit 0
@@ -221,23 +192,18 @@ USAGE:
221
192
 
222
193
  DESCRIPTION:
223
194
  This script tests the automated version bump system including:
224
- - Commit analysis functionality
225
- - Gem publication script compatibility
226
- - Workflow file syntax validation
195
+ - Commit analysis functionality (scripts/analyze-commits.sh wrapper
196
+ and scripts/utils/analyze-commits implementation)
197
+ - Release command compatibility (scripts/bin/release)
198
+ - Workflow file syntax validation (.github/workflows/version-bump.yml)
227
199
  - Integration between components
228
200
  - Conventional commit detection
229
201
 
230
202
  REQUIREMENTS:
231
203
  - Git repository with commit history
232
- - Executable scripts in scripts/ directory
233
- - Valid GitHub Actions workflow files
234
-
235
- OUTPUT:
236
- Detailed test results and summary
237
- Exit code 0 on success, 1 on failure
204
+ - Bash 3.2+ compatible environment
238
205
  EOF
239
206
  exit 0
240
207
  fi
241
208
 
242
- # Execute main function
243
- main "$@"
209
+ main "$@"
@@ -166,9 +166,7 @@ main() {
166
166
  log_info "Testing core files..."
167
167
 
168
168
  test_file_exists "_includes/components/mermaid.html" "Mermaid include file exists"
169
- test_file_exists "pages/_docs/jekyll/mermaid.md" "Main documentation exists"
170
- test_file_exists "pages/_docs/jekyll/mermaid-test-suite.md" "Test suite exists"
171
- test_file_exists "pages/_docs/jekyll/jekyll-diagram-with-mermaid.md" "Tutorial exists"
169
+ test_file_exists "pages/_docs/features/mermaid-diagrams.md" "Main documentation exists"
172
170
 
173
171
  # Configuration tests
174
172
  log_info "Testing configuration..."
@@ -183,16 +181,14 @@ main() {
183
181
 
184
182
  test_file_content "_includes/components/mermaid.html" "site.mermaid.src" "Mermaid script from _config (local vendor path)"
185
183
  test_file_content "_includes/components/mermaid.html" "mermaid.initialize" "Mermaid initialization script"
186
- test_file_content "_includes/components/mermaid.html" "forest" "Forest theme configured"
187
- test_file_content "_includes/components/mermaid.html" "FontAwesome" "FontAwesome support included"
184
+ test_file_content "_includes/components/mermaid.html" "data-bs-theme" "Bootstrap theme detection configured"
185
+ test_file_content "_includes/components/mermaid.html" "getMermaidConfig" "Adaptive light/dark theming configured"
188
186
 
189
187
  # Documentation tests
190
188
  log_info "Testing documentation..."
191
189
 
192
- test_file_content "pages/_docs/jekyll/mermaid.md" "mermaid: true" "Main docs have front matter"
193
- test_file_content "pages/_docs/jekyll/mermaid-test-suite.md" "mermaid: true" "Test suite has front matter"
194
- test_file_content "pages/_docs/jekyll/mermaid.md" "graph TD" "Main docs have examples"
195
- test_file_content "pages/_docs/jekyll/mermaid-test-suite.md" "graph TD" "Test suite has examples"
190
+ test_file_content "pages/_docs/features/mermaid-diagrams.md" "mermaid: true" "Main docs have front matter"
191
+ test_file_content "pages/_docs/features/mermaid-diagrams.md" "graph TD" "Main docs have examples"
196
192
 
197
193
  # Server tests (if not quick mode)
198
194
  if [ "$QUICK" = false ]; then
@@ -204,11 +200,10 @@ main() {
204
200
 
205
201
  # Check if local server is running
206
202
  if curl -s -f "http://localhost:4000" >/dev/null 2>&1; then
207
- test_url "http://localhost:4000/docs/jekyll/mermaid/" "Main documentation accessible"
208
- test_url "http://localhost:4000/docs/jekyll/mermaid-test-suite/" "Test suite accessible"
209
- test_mermaid_script "http://localhost:4000/docs/jekyll/mermaid-test-suite/" "Mermaid script loads on test page"
210
- test_mermaid_init "http://localhost:4000/docs/jekyll/mermaid-test-suite/" "Mermaid initializes on test page"
211
- test_diagram_rendering "http://localhost:4000/docs/jekyll/mermaid-test-suite/" "Diagrams render on test page"
203
+ test_url "http://localhost:4000/docs/features/mermaid-diagrams/" "Main documentation accessible"
204
+ test_mermaid_script "http://localhost:4000/docs/features/mermaid-diagrams/" "Mermaid script loads on docs page"
205
+ test_mermaid_init "http://localhost:4000/docs/features/mermaid-diagrams/" "Mermaid initializes on docs page"
206
+ test_diagram_rendering "http://localhost:4000/docs/features/mermaid-diagrams/" "Diagrams render on docs page"
212
207
  else
213
208
  log_warning "Local Jekyll server not running. Start with: bundle exec jekyll serve"
214
209
  fi
@@ -220,11 +215,10 @@ main() {
220
215
 
221
216
  # Check if Docker container is running
222
217
  if docker ps | grep -q "zer0-mistakes-jekyll"; then
223
- test_url "http://localhost:4000/docs/jekyll/mermaid/" "Docker: Main documentation accessible"
224
- test_url "http://localhost:4000/docs/jekyll/mermaid-test-suite/" "Docker: Test suite accessible"
225
- test_mermaid_script "http://localhost:4000/docs/jekyll/mermaid-test-suite/" "Docker: Mermaid script loads"
226
- test_mermaid_init "http://localhost:4000/docs/jekyll/mermaid-test-suite/" "Docker: Mermaid initializes"
227
- test_diagram_rendering "http://localhost:4000/docs/jekyll/mermaid-test-suite/" "Docker: Diagrams render"
218
+ test_url "http://localhost:4000/docs/features/mermaid-diagrams/" "Docker: Main documentation accessible"
219
+ test_mermaid_script "http://localhost:4000/docs/features/mermaid-diagrams/" "Docker: Mermaid script loads"
220
+ test_mermaid_init "http://localhost:4000/docs/features/mermaid-diagrams/" "Docker: Mermaid initializes"
221
+ test_diagram_rendering "http://localhost:4000/docs/features/mermaid-diagrams/" "Docker: Diagrams render"
228
222
  else
229
223
  log_warning "Docker container not running. Start with: docker-compose up -d"
230
224
  fi
@@ -87,4 +87,72 @@ test_categorization "security: patch vulnerability" "security"
87
87
  test_categorization "BREAKING: major change" "breaking"
88
88
  test_categorization "random commit" "other"
89
89
 
90
+ # Test: update_changelog_file
91
+ echo -e "\nTesting update_changelog_file..."
92
+
93
+ # Each case runs in a throwaway directory; CHANGELOG_FILE is the relative
94
+ # default ("CHANGELOG.md"), so the function operates on the temp copy.
95
+ _changelog_tmp=$(mktemp -d)
96
+ pushd "$_changelog_tmp" >/dev/null
97
+
98
+ # Case 1: pending [Unreleased] notes are folded into the new entry and the
99
+ # preamble stays at the top of the file.
100
+ cat > CHANGELOG.md <<'FIXTURE'
101
+ # Changelog
102
+
103
+ All notable changes are documented here.
104
+
105
+ ## [Unreleased]
106
+
107
+ ### Added
108
+ - Pending feature A
109
+
110
+ ## [1.0.0] - 2026-01-01
111
+
112
+ ### Added
113
+ - Initial release
114
+ FIXTURE
115
+
116
+ update_changelog_file "## [1.1.0] - 2026-06-10
117
+
118
+ ### Changed
119
+ - Version bump: minor release
120
+ " >/dev/null 2>&1
121
+
122
+ assert_false "grep -q '^## \[Unreleased\]' CHANGELOG.md" "Pending Unreleased section is consumed"
123
+ assert_true "grep -q 'Pending feature A' CHANGELOG.md" "Pending notes are preserved"
124
+ assert_equals "# Changelog" "$(head -n 1 CHANGELOG.md)" "Preamble heading stays on line 1"
125
+ # The folded notes must land inside the new 1.1.0 entry (above 1.0.0)
126
+ _pending_line=$(grep -n 'Pending feature A' CHANGELOG.md | cut -d: -f1)
127
+ _v110_line=$(grep -n '^## \[1.1.0\]' CHANGELOG.md | cut -d: -f1)
128
+ _v100_line=$(grep -n '^## \[1.0.0\]' CHANGELOG.md | cut -d: -f1)
129
+ assert_true "[[ $_pending_line -gt $_v110_line && $_pending_line -lt $_v100_line ]]" "Folded notes live inside the new entry"
130
+
131
+ # Case 2: without an Unreleased section the entry is inserted before the
132
+ # first release heading, after the preamble.
133
+ cat > CHANGELOG.md <<'FIXTURE'
134
+ # Changelog
135
+
136
+ All notable changes are documented here.
137
+
138
+ ## [1.0.0] - 2026-01-01
139
+
140
+ ### Added
141
+ - Initial release
142
+ FIXTURE
143
+
144
+ update_changelog_file "## [1.0.1] - 2026-06-10
145
+
146
+ ### Fixed
147
+ - A bug
148
+ " >/dev/null 2>&1
149
+
150
+ _v101_line=$(grep -n '^## \[1.0.1\]' CHANGELOG.md | cut -d: -f1)
151
+ _v100_line=$(grep -n '^## \[1.0.0\]' CHANGELOG.md | cut -d: -f1)
152
+ assert_true "[[ $_v101_line -lt $_v100_line ]]" "New entry inserted before previous release"
153
+ assert_true "grep -q 'All notable changes' CHANGELOG.md" "Preamble preserved without Unreleased"
154
+
155
+ popd >/dev/null
156
+ rm -rf "$_changelog_tmp"
157
+
90
158
  echo -e "\n${GREEN}changelog.sh tests complete${NC}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-zer0
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amr Abdel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-03 00:00:00.000000000 Z
11
+ date: 2026-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll