Proposal: introduces PostHTML into Hexo
- Dominant language
- TypeScript
- Stars
- 41.8k
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Since Hexo is a framework outputting HTML files. So we should introduce an HTML transformer into Hexo's core. [PostHTML](https://posthtml.org/) is a tool to transform HTML/XML. With PostHTML we can:
- Migrate away from RegExp and manipulate PostHTML AST instead.
- `meta_generator`: https://github.com/hexojs/hexo/blob/master/lib/plugins/filter/after_render/meta_generator.js
- `external_link`: https://github.com/hexojs/hexo/blob/4.2.1/lib/plugins/filter/after_render/external_link.js
- Injector plugin: https://github.com/hexojs/hexo/blob/master/lib/extend/injector.js
- Enables possibility for more features that require manipulation of HTML (E.g. lazyload images. We can set the `data-src` attribute directly in the Hexo, and inject the `lazyload.js` directly to the output, without being limited by the themes)
- Integrate [htmlnano](https://github.com/posthtml/htmlnano) directly into Hexo.
Contributor guide
Assessment
This issue has not been assessed yet.