-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
62 lines (51 loc) · 1.95 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var gulp = require('gulp')
var runSequence = require('run-sequence')
var less = require('gulp-less')
var concat = require('gulp-concat')
var uglify = require('gulp-uglify')
var cleanCSS = require('gulp-clean-css')
var rename = require('gulp-rename')
var run = require('gulp-run');
var themeCssSrc = './themes/hugo-future-imperfect-modified/static/css/';
var themeJsSrc = './themes/hugo-future-imperfect-modified/static/js/';
gulp.task('js:build', function() {
return gulp.src(['./static/js/jquery.min.js',
'./static/js/skel.min.js',
'./static/js/util.js',
'./static/js/main.js',
'./static/js/backToTop.js',
'./static/js/highlight.pack.js'])
.pipe(concat('site.js'))
.pipe(gulp.dest('./static/js/'))
.pipe(rename('site.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./static/js/'));
});
gulp.task('css:build', function() {
return gulp.src(['./static/css/google-font.css',
'./static/css/font-awesome.min.css',
'./static/css/main.css',
'./static/css/add-on.css',
'./static/css/monokai-sublime.css',
'./static/css/more.css'])
.pipe(concat('site.css'))
.pipe(gulp.dest('./static/css/'))
.pipe(rename('site.min.css'))
.pipe(cleanCSS())
.pipe(gulp.dest('./static/css/'));
});
// gulp.task('hugo', function () {
// return exec('hugo --config config.production.toml', function (err, stdout, stderr) {
// console.log(stdout); // See Hugo output
// console.log(stderr); // Debugging feedback
// //fetch(err);
// });
// })
// gulp.task('hugo', function () {
// return cp.execFile('hugo --config config.production.toml');
// })
gulp.task('hugoit', function() {
return run('hugo --config config.production.toml').exec();
})
gulp.task('build', runSequence('js:build', 'css:build', 'hugoit'));
gulp.task('default', ['less:main', 'less:watch']);