Proposal: introduces PostHTML into Hexo
Author: SukkaWCreated Oct 13, 2021Updated Aug 6, 2026
Labelsproposal
Since Hexo is a framework outputting HTML files. So we should introduce an HTML transformer into Hexo's core. PostHTML is a tool to transform HTML/XML. With PostHTML we can:
- Migrate away from RegExp and manipulate PostHTML AST instead.
- Enables possibility for more features that require manipulation of HTML (E.g. lazyload images. We can set the
data-srcattribute directly in the Hexo, and inject thelazyload.jsdirectly to the output, without being limited by the themes) - Integrate htmlnano directly into Hexo.
Source: hexojs/hexo