2018-09-27 05:27:16 +00:00
# Hexo-yam
2016-06-23 05:27:24 +00:00
2018-09-27 07:13:18 +00:00
[![npm version ](https://badge.fury.io/js/hexo-yam.svg )](https://www.npmjs.com/package/hexo-yam)
2018-09-27 07:49:26 +00:00
[![Build Status ](https://travis-ci.com/weyusi/hexo-yam.svg?branch=master )](https://travis-ci.com/weyusi/hexo-yam)
2018-09-27 07:13:18 +00:00
[![NPM Dependencies ](https://david-dm.org/weyusi/hexo-yam.svg )](https://david-dm.org/weyusi/hexo-yam)
2018-09-28 02:24:17 +00:00
[![Known Vulnerabilities ](https://snyk.io/test/npm/hexo-yam/badge.svg )](https://snyk.io/test/npm/hexo-yam)
[![Greenkeeper badge ](https://badges.greenkeeper.io/weyusi/hexo-yam.svg )](https://greenkeeper.io/)
2018-09-27 07:13:18 +00:00
2018-09-27 05:27:16 +00:00
> This project is based on [hexo-neat](https://github.com/rozbo/hexo-neat)
2018-09-27 06:55:30 +00:00
2018-09-30 07:30:32 +00:00
Yet Another Minifier for Hexo. Minify and compress html, js and css. Support gzip and [brotli ](https://en.wikipedia.org/wiki/Brotli ) [compressions ](https://en.wikipedia.org/wiki/HTTP_compression ).
2018-09-27 06:55:30 +00:00
2018-10-12 03:34:45 +00:00
The original package has not been [updated ](https://www.npmjs.com/package/hexo-neat ) for a while. I update the [dependencies ](https://github.com/weyusi/hexo-yam/blob/master/package.json ) and add compression support.
2016-05-26 11:09:41 +00:00
2018-09-27 05:27:16 +00:00
All the options are the same, so you can use this as a drop-in replacement.
2016-05-26 11:09:41 +00:00
## Installation
``` bash
2018-09-27 05:27:16 +00:00
$ npm install hexo-yam --save
2016-05-26 11:09:41 +00:00
```
2018-09-27 05:27:16 +00:00
## Usage
To enable this plugin, insert the following to `_config.yml` :
2016-05-26 11:09:41 +00:00
``` yaml
2016-05-26 11:23:57 +00:00
neat_enable: true
```
2018-09-27 05:27:16 +00:00
For further customization, see below.
2016-05-26 11:23:57 +00:00
2018-09-27 05:27:16 +00:00
## Options
2016-05-26 11:23:57 +00:00
``` yaml
neat_html:
2016-05-26 11:09:41 +00:00
enable: true
2016-06-23 05:27:24 +00:00
exclude:
2016-05-26 11:09:41 +00:00
```
- **enable** - Enable the plugin. Defaults to `true` .
2018-06-29 08:11:00 +00:00
- **logger** - Print log switch. Defaults to `true` .
2016-05-26 11:09:41 +00:00
- **exclude**: Exclude files
2018-09-27 08:43:19 +00:00
**Note:** For more options, see '[HTMLMinifier](https://github.com/kangax/html-minifier)'
2018-09-27 05:27:16 +00:00
2016-05-26 11:09:41 +00:00
----------
``` yaml
2016-05-26 11:23:57 +00:00
neat_css:
2016-05-26 11:09:41 +00:00
enable: true
2016-06-23 05:27:24 +00:00
exclude:
2016-05-26 11:09:41 +00:00
- '*.min.css'
```
- **enable** - Enable the plugin. Defaults to `true` .
2018-06-29 08:11:00 +00:00
- **logger** - Print log switch. Defaults to `true` .
2016-05-26 11:09:41 +00:00
- **exclude**: Exclude files
----------
``` yaml
2016-05-26 11:23:57 +00:00
neat_js:
2016-05-26 11:09:41 +00:00
enable: true
mangle: true
output:
compress:
2016-06-23 05:27:24 +00:00
exclude:
2016-05-26 11:09:41 +00:00
- '*.min.js'
```
- **enable** - Enable the plugin. Defaults to `true` .
- **mangle**: Mangle file names
2018-06-29 08:11:00 +00:00
- **logger** - Print log switch. Defaults to `true` .
2016-05-26 11:09:41 +00:00
- **output**: Output options
- **compress**: Compress options
- **exclude**: Exclude files
2018-09-27 08:43:19 +00:00
**Note:** For more options, see '[UglifyJS](https://github.com/mishoo/UglifyJS2)'
2016-05-26 11:09:41 +00:00
2018-09-28 07:43:54 +00:00
----------
``` yaml
2018-09-29 05:58:43 +00:00
neat_gzip:
2018-09-28 07:43:54 +00:00
enable: true
```
- **enable** - Enable the plugin. Defaults to `true` .
2018-09-29 05:58:43 +00:00
- **logger** - Print log switch. Defaults to `true` .
2016-05-26 11:09:41 +00:00
2018-09-30 07:30:32 +00:00
----------
``` yaml
neat_brotli:
enable: true
```
- **enable** - Enable the plugin. Defaults to `true` .
- **logger** - Print log switch. Defaults to `true` .
2018-09-27 05:27:16 +00:00
## Credits
All credits go to the following work:
- [hexo-neat ](https://github.com/rozbo/hexo-neat ) by rozbo
2016-05-26 11:23:57 +00:00
- neat html by [HTMLMinifier ](https://github.com/kangax/html-minifier )
- neat css by [clean-css ](https://github.com/jakubpawlowicz/clean-css )
- neat js by [UglifyJS ](http://lisperator.net/uglifyjs/ )
2018-09-29 05:58:43 +00:00
- gzip inspired by [hexo-generator-optimize ](https://github.com/JackyRen/hexo-generator-optimize )