1 Star 1 Fork 0

LEARN / hexo-theme-next

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gulpfile.coffee 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
fs = require('fs')
path = require('path')
gulp = require('gulp')
jshint = require('gulp-jshint')
stylish = require('jshint-stylish')
shell = require('gulp-shell')
yaml = require('js-yaml')
gulp.task 'lint', ->
return gulp.src([
'./source/js/src/utils.js',
'./source/js/src/motion.js',
'./source/js/src/hook-duoshuo.js',
'./source/js/src/algolia-search.js',
'./source/js/src/bootstrap.js',
'./source/js/src/post-details.js',
'./source/js/src/schemes/pisces.js'
]).pipe jshint()
.pipe jshint.reporter(stylish)
gulp.task 'lint:stylus', shell.task [
'"./node_modules/.bin/stylint" ./source/css/'
]
gulp.task 'validate:config', (cb) ->
themeConfig = fs.readFileSync path.join(__dirname, '_config.yml')
try
yaml.safeLoad(themeConfig)
cb()
catch error
cb new Error(error)
gulp.task 'validate:languages', (cb) ->
languagesPath = path.join __dirname, 'languages'
languages = fs.readdirSync languagesPath
errors = []
for lang in languages
languagePath = path.join languagesPath, lang
try
yaml.safeLoad fs.readFileSync(languagePath), {
filename: path.relative(__dirname, languagePath)
}
catch error
errors.push error
if errors.length == 0
cb()
else
cb(errors)
gulp.task 'default', ['lint', 'validate:config', 'validate:languages']
1
https://gitee.com/huoxd/hexo-theme-next.git
git@gitee.com:huoxd/hexo-theme-next.git
huoxd
hexo-theme-next
hexo-theme-next
master

搜索帮助