-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathgulpfile.js
More file actions
76 lines (66 loc) · 1.64 KB
/
gulpfile.js
File metadata and controls
76 lines (66 loc) · 1.64 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Defining requirements
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var harp = require('harp');
var watch = require('gulp-watch');
var del = require('del');
var prettify = require('gulp-prettify');
var clean = require('gulp-clean');
var paths = {
templates: '_harp/public/**/*.{jade,md}',
css: '_harp/public/assets/css/*.css',
sass: ['_harp/public/assets/**/*.scss', 'assets/stylesheets/*.scss'],
images: '_harp/public/assets/img/**/*',
js: '_harp/public/assets/js/**/*.js',
harp: '_harp/',
harpPublic: '_harp/public/',
harpCompiled: 'www/'
};
// Live Reload
gulp.task('watch', ['serve'], function() {
gulp.watch('_harp/**/*', function() {
reload(paths.harp, {stream: true});
console.log("Changes detected");
});
});
/**
* Serve the Harp Site from the src directory
*/
gulp.task('serve', function () {
harp.server(paths.harp, {
port: 3000
}, function () {
browserSync({
files: [
'public/**.jade,',
'public/**.json,',
'public/_partials/**.jade,'
],
proxy: "localhost:3000",
open: true,
ghostMode: {
clicks: true,
forms: false,
scroll: true
},
logLevel: "debug",
notify: false
});
});
});
// Compile and prepare for GitHub Pages
gulp.task('compile', function() {
return harp.compile(paths.harp , paths.harpCompiled, function() {
// After compiling with harp, move to root directory
gulp.src('_harp/www/**/**/*')
.pipe(gulp.dest('./'));
});
});
gulp.task('clean', function() {
return del.sync(['_harp/www']);
});
/**
* Default task
*/
gulp.task('default', ['watch']), function() {};