style: Standard JS

This commit is contained in:
weyusi 2019-05-02 15:55:43 +09:30
parent cceae36368
commit cdee4c0768
2 changed files with 13 additions and 13 deletions

View File

@ -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')

View File

@ -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)
})
}
})