mirror of https://github.com/curbengh/hexo-yam
style: Standard JS
This commit is contained in:
parent
cceae36368
commit
cdee4c0768
6
index.js
6
index.js
|
@ -37,7 +37,7 @@ if (hexo.config.neat_enable === true) {
|
|||
hexo.config.neat_svg = Object.assign({
|
||||
enable: true,
|
||||
logger: false,
|
||||
include: ['*.svg','!*.min.svg'],
|
||||
include: ['*.svg', '!*.min.svg'],
|
||||
plugin: []
|
||||
}, hexo.config.neat_svg)
|
||||
|
||||
|
@ -45,14 +45,14 @@ if (hexo.config.neat_enable === true) {
|
|||
hexo.config.neat_gzip = Object.assign({
|
||||
enable: true,
|
||||
logger: false,
|
||||
include: ['*.html','*.css','*.js','*.txt','*.ttf','*.atom','*.stl','*.xml','*.svg','*.eot','*.json']
|
||||
include: ['*.html', '*.css', '*.js', '*.txt', '*.ttf', '*.atom', '*.stl', '*.xml', '*.svg', '*.eot', '*.json']
|
||||
}, hexo.config.neat_gzip)
|
||||
|
||||
// brotli compression
|
||||
hexo.config.neat_brotli = Object.assign({
|
||||
enable: true,
|
||||
logger: false,
|
||||
include: ['*.html','*.css','*.js','*.txt','*.ttf','*.atom','*.stl','*.xml','*.svg','*.eot','*.json']
|
||||
include: ['*.html', '*.css', '*.js', '*.txt', '*.ttf', '*.atom', '*.stl', '*.xml', '*.svg', '*.eot', '*.json']
|
||||
}, hexo.config.neat_brotli)
|
||||
|
||||
const filter = require('./lib/filter')
|
||||
|
|
|
@ -107,16 +107,16 @@ function logicSvg () {
|
|||
assetPath.on('end', () => {
|
||||
if (assetTxt.length) {
|
||||
// Minify using svgo
|
||||
new svgo(options).optimize(assetTxt).then(function(result) {
|
||||
// Replace the original file with the minified.
|
||||
route.set(path, result.data)
|
||||
// Logging
|
||||
let saved = ((assetTxt.length - result.data.length) / assetTxt.length * 100).toFixed(2)
|
||||
if (options.logger) {
|
||||
let log = hexo.log || console.log
|
||||
log.log('Minify the svg: %s [%s saved]', path, saved + '%')
|
||||
}
|
||||
resolve(assetTxt)
|
||||
new svgo(options).optimize(assetTxt).then(function (result) {
|
||||
// Replace the original file with the minified.
|
||||
route.set(path, result.data)
|
||||
// Logging
|
||||
let saved = ((assetTxt.length - result.data.length) / assetTxt.length * 100).toFixed(2)
|
||||
if (options.logger) {
|
||||
let log = hexo.log || console.log
|
||||
log.log('Minify the svg: %s [%s saved]', path, saved + '%')
|
||||
}
|
||||
resolve(assetTxt)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue