https://github.com/uiolee/hexo-htmlnano
Minify HTML files with htmlnano
https://github.com/uiolee/hexo-htmlnano
hexo hexo-plugin html htmlnano minify
Last synced: 4 months ago
JSON representation
Minify HTML files with htmlnano
- Host: GitHub
- URL: https://github.com/uiolee/hexo-htmlnano
- Owner: uiolee
- License: mpl-2.0
- Created: 2024-01-30T16:01:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T10:44:05.000Z (about 1 year ago)
- Last Synced: 2025-07-28T00:06:03.292Z (11 months ago)
- Topics: hexo, hexo-plugin, html, htmlnano, minify
- Language: TypeScript
- Homepage: https://npmjs.com/@uiolee/hexo-htmlnano
- Size: 413 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hexo-htmlnano
[](https://github.com/uiolee/hexo-htmlnano/tags)
[](https://github.com/uiolee/hexo-htmlnano/releases)
[](https://github.com/uiolee/hexo-htmlnano/compare/...main)
[](#hexo-htmlnano)
[](https://coveralls.io/github/uiolee/hexo-htmlnano?branch=main)
[](https://github.com/uiolee/hexo-htmlnano/actions/workflows/ci.yml)
[](https://libraries.io/github/uiolee/hexo-htmlnano#dependencies)
Minify HTML files with [htmlnano](https://www.npmjs.com/package/htmlnano)
## Install
[](https://www.npmjs.com/package/@uiolee/hexo-htmlnano)
[](https://nodejs.org/)
[](./LICENSE)
[](#hexo-htmlnano)
[](#hexo-htmlnano)
[](https://libraries.io/npm/@uiolee%2Fhexo-htmlnano/tree)
```bash
pnpm add @uiolee/hexo-htmlnano
# npm i @uiolee/hexo-htmlnano
```
## Configuration
### Default Configuration
> Defined in [src/index.ts](src/index.ts)
```yaml
hexo_htmlnano:
enable: true
priority: 999
exclude: []
presetName: "safe"
htmlnanoOptions:
removeEmptyAttributes: false
collapseWhitespace: "conservative"
postHtmlOptions:
```
### Customize
| name | default | type | note |
| --------------- | ---------------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| enable | `true` | boolean | set `false` to disable this plugin. |
| priority | `999` | number | define the [priority](https://hexo.io/api/filter#Synopsis) of this plugin.
Lower priority means that it will be executed first. |
| exclude | `[]` | array\ | Exclude files from being minified.
Support [globbing patterns](https://github.com/micromatch/micromatch#extended-globbing). |
| presetName | `"safe"` | string | the name of [htmlnano#Preset](https://htmlnano.netlify.app/presets). |
| htmlnanoOptions | see [src/index.ts#L10](src/index.ts#L10) | object | see [htmlnamo#modules](https://htmlnano.netlify.app/modules) for more. |
| postHtmlOptions | see [src/index.ts#L20](src/index.ts#L20) | object | see [posthtml#usage](https://github.com/posthtml/posthtml#usage) for more. |