This commit is contained in:
rozbo 2016-05-26 19:23:57 +08:00
parent f5e52a6fa8
commit 079b37a7fc
1 changed files with 20 additions and 38 deletions

View File

@ -1,37 +1,34 @@
# Hexo-all-minifier # Hexo-neat
[![npm version](https://badge.fury.io/js/hexo-all-minifier.svg)](https://badge.fury.io/js/hexo-all-minifier)
[![NPM Dependencies](https://david-dm.org/unhealthy/hexo-all-minifier.svg)](https://www.npmjs.com/package/hexo-all-minifier)
All in one. Minifier & Optimization plugin for [Hexo](https://hexo.io). I want a profect page to show for my blog, so I made this.
Since most of the optimize plugin for [HEXO](https://hexo.io) have been deprecated, and [HEXO](https://hexo.io) has upgraded to 3.XX, so I decide to implement this plugin.
## Show
[青枫浦](http://post.zz173.com)
## Installation ## Installation
``` bash ``` bash
$ npm install hexo-all-minifier --save $ npm install hexo-neat --save
``` ```
## Components
Integrate all the official minifier plugins of HEXO and a imagemin plugin:
- [hexo-html-minifier](https://github.com/hexojs/hexo-html-minifier), which is based on [HTMLMinifier](https://github.com/kangax/html-minifier)
- [hexo-clean-css](https://github.com/hexojs/hexo-clean-css), which is based on [clean-css](https://github.com/jakubpawlowicz/clean-css)
- [hexo-uglify](https://github.com/hexojs/hexo-uglify), which is based on [UglifyJS](http://lisperator.net/uglifyjs/)
- [hexo-imagemin](https://github.com/vseventer/hexo-imagemin), which is based on [imagemin](https://github.com/imagemin/imagemin)
Thanks for their works.
## Options ## Options
To Enable Auto neat , you must config like this:
``` yaml ``` yaml
html_minifier: neat_enable: true
```
``` yaml
neat_html:
enable: true enable: true
exclude: exclude:
``` ```
- **enable** - Enable the plugin. Defaults to `true`. - **enable** - Enable the plugin. Defaults to `true`.
- **exclude**: Exclude files - **exclude**: Exclude files
**Note:** there are so many params please see '[HTMLMinifier](https://github.com/kangax/html-minifier)'
---------- ----------
``` yaml ``` yaml
css_minifier: neat_css:
enable: true enable: true
exclude: exclude:
- '*.min.css' - '*.min.css'
@ -42,7 +39,7 @@ css_minifier:
---------- ----------
``` yaml ``` yaml
js_minifier: neat_js:
enable: true enable: true
mangle: true mangle: true
output: output:
@ -56,24 +53,9 @@ js_minifier:
- **compress**: Compress options - **compress**: Compress options
- **exclude**: Exclude files - **exclude**: Exclude files
----------
```yaml ## Thanks
image_minifier: Say Very Thanks for this gays:
enable: true - neat html by [HTMLMinifier](https://github.com/kangax/html-minifier)
interlaced: false - neat css by [clean-css](https://github.com/jakubpawlowicz/clean-css)
multipass: false - neat js by [UglifyJS](http://lisperator.net/uglifyjs/)
optimizationLevel: 2
pngquant: false
progressive: false
```
- **enable** - Enable the plugin. Defaults to `true`.
- **interlaced** - Interlace gif for progressive rendering. Defaults to `false`.
- **multipass** - Optimize svg multiple times until its fully optimized. Defaults to `false`.
- **optimizationLevel** - Select an optimization level between 0 and 7. Defaults to `2`.
- **pngquant** - Enable [imagemin-pngquant](https://github.com/imagemin/imagemin-pngquant) plugin. Defaults to `false`.
- **progressive** - Lossless conversion to progressive. Defaults to `false`.
To be continued