Skip to content

Update: hexo 6.3 -> 8.1.2 - #56

Merged
Aetf merged 2 commits into
developfrom
chore/hexo-8
Aug 6, 2026
Merged

Update: hexo 6.3 -> 8.1.2#56
Aetf merged 2 commits into
developfrom
chore/hexo-8

Conversation

@Aetf

@Aetf Aetf commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Unblocked — hexo-next-publist 2.2.4 is published with the Hexo 7/8 Box fix, so npm ci resolves cleanly and CI is green.

What had to change beyond the version number

1. syntax_highlighter: in _config.yml — the big one.

Hexo 7 replaced the highlight.enable / prismjs.enable switches with a single syntax_highlighter key. The old ones are now silently ignored, and an unset syntax_highlighter falls back to highlight.js. Its backtick_code_block filter shares priority 10 with hexo-prism-plus but is registered first, so it swallowed every fenced block:

before_post_render filters: _before_post_render@0, backtickCodeBlock@10, titlecaseFilter@10, _transform@10

The symptom was bare <pre> with no language class across the whole site, and a prism bundle reduced to only the languages reached via {% includecode %} (c, clike, cpp — no bash). Setting syntax_highlighter: empty makes the built-in bail and hands the fences back to prism-plus.

The old keys are kept alongside, because NexT still reads config.highlight.wrap and config.prismjs.preprocess when computing its client-side hljswrap/prism flags. Without them those become undefined and drop out of the emitted next-config JSON — harmless in practice since both are only used in boolean contexts, but it made every page differ for no reason.

2. scripts/tags/random_xkcd.js used this.site.data.xkcd.

Hexo 7+ calls tags via Reflect.apply(fn, context.ctx, ...), so this is the nunjucks render context and has no site. The build died with TypeError: Cannot read properties of undefined (reading 'data') reported against an "unknown path" template, which is not much to go on. Uses hexo.locals.get('data') now, which works on every version.

3. An overrides entry for hexo-filter-responsive-images.

It still declares hexo: 3.x || 4.x || 5.x || 6.x || 7.x, so npm ci ERESOLVEs. Reading its source, it requires no hexo internals at all — only the injected hexo global plus hexo-fs/sharp — so the range is just stale metadata.

4. hexo-cli floor raised to ^4.3.2, and hexo-next-publist to ^2.2.4.

Verification

Built the entire site on 6.3.0 and on 8.1.2 and diffed public/ file by file. After normalising the three nondeterministic bits — prism's random code-block ids, the random xkcd element id, and NexT's random links-of-author colour — what is left is:

  • article:tag ordering in the og meta of 13 posts. Same tag set, verified by hashing the sorted list per file: all identical.
  • Property ordering inside publist's embedded CSS, from cssnano 5 → 6 in the plugin's own tree. Parsed both stylesheets and compared per selector: same selectors, same declaration sets, zero semantic difference.
  • One genuine change, and it's a fix — see below.

43/43 tests pass. Headless render of /, /blog, /about, /projects, /research and a post is clean with zero page errors, including the publist badges on /research.

Hexo 8 fixes a broken TOC

/blog/2016/08/03/gsoc-kdevelop-lldb-status/ starts with <h3> headings and then introduces an <h2>. Hexo 6's tocObj mishandled that out-of-order sequence and emitted the level-2 entry as an unnumbered sibling with its children restarting at 1:

TOC entries
Hexo 6 1. Config Page / 2. Debugging / (no number) Feature Implementation Status / 1. Known Issues / 2. Upstream Bugs
Hexo 8 1. Config Page / 2. Debugging / 3. Feature Implementation Status / 3.1. Known Issues / 3.2. Upstream Bugs

Same five entries, nothing hidden, correct hierarchy. Every other post's TOC is byte-identical.

🤖 Generated with Claude Code

Aetf and others added 2 commits August 5, 2026 22:49
Four things had to change beyond the version bump:

* `syntax_highlighter:` in _config.yml. Hexo 7 replaced the
  `highlight.enable` / `prismjs.enable` switches with a single
  `syntax_highlighter` key. The old ones are now silently ignored, and an
  unset `syntax_highlighter` falls back to highlight.js — whose
  `backtick_code_block` filter shares priority 10 with hexo-prism-plus but
  is registered first, so it swallowed every fenced block. The symptom was
  bare `<pre>` with no language class site-wide and a prism bundle
  containing only the languages reached via `{% includecode %}`. The old
  keys are kept alongside because NexT still reads `config.highlight.wrap`
  and `config.prismjs.preprocess` for its `hljswrap`/`prism` client flags.

* `scripts/tags/random_xkcd.js` used `this.site.data.xkcd`. Hexo 7+ calls
  tags via `Reflect.apply(fn, context.ctx, ...)`, so `this` is the nunjucks
  render context and has no `site` — the build died with
  `Cannot read properties of undefined (reading 'data')` against an
  "unknown path" template. Uses `hexo.locals.get('data')` now.

* An `overrides` entry for hexo-filter-responsive-images, which still
  declares `hexo: 3.x || 4.x || 5.x || 6.x || 7.x`. It requires no hexo
  internals at all (only the injected global plus hexo-fs/sharp), so the
  range is just stale metadata.

* hexo-cli floor raised to ^4.3.2.

Verified by building the whole site on 6.3.0 and on 8.1.2 and diffing
`public/`. After normalising the three nondeterministic bits (prism's
random code-block ids, the random xkcd element id, NexT's random
links-of-author colour) the only differences left are `article:tag`
ordering in og meta — same tag set, confirmed by hashing the sorted
lists — and property ordering inside publist's embedded CSS. No content,
structural or styling change. 43/43 tests pass and a headless render of
/, /blog, /about, /projects, /research and a post is clean.

BLOCKED: needs hexo-next-publist released with the Hexo 7/8 Box fix
(Aetf/hexo-next-publist). The lockfile here still resolves the published
2.2.1, which fails to load on Hexo 8, so `npm ci` + build will fail in CI
until that release lands and this lockfile is regenerated against it.

Co-Authored-By: Claude <noreply@anthropic.com>
Picks up the Hexo 7/8 Box fix (Aetf/hexo-next-publist#197), which is what
this branch was blocked on. `npm ci` now resolves cleanly against Hexo
8.1.2 — previously it ERESOLVEd on 2.2.1's `hexo: ^6.3.0` peer.

Co-Authored-By: Claude <noreply@anthropic.com>
@Aetf Aetf changed the title Update: hexo 6.3 -> 8.1.2 (blocked on publist release) Update: hexo 6.3 -> 8.1.2 Aug 6, 2026
@Aetf
Aetf marked this pull request as ready for review August 6, 2026 10:28
@Aetf
Aetf merged commit e32dfdf into develop Aug 6, 2026
2 checks passed
@Aetf
Aetf deleted the chore/hexo-8 branch August 6, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant