forked from amcss/amcss.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
53 lines (50 loc) · 1.34 KB
/
gulpfile.js
File metadata and controls
53 lines (50 loc) · 1.34 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
var gulp = require('gulp');
var ghPages = require('gulp-gh-pages');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var harp = require('harp');
/**
* Serve the Harp Site from the src directory
*/
gulp.task('serve', function () {
harp.server(__dirname + '/src', {
port: 9001
}, function () {
browserSync({
port: 3001,
proxy: "localhost:9001",
open: false,
/* Hide the notification. It gets annoying */
notify: {
styles: ['opacity: 0', 'position: absolute']
}
});
/**
* Watch for scss changes, tell BrowserSync to refresh main.css
*/
gulp.watch("src/**/*.scss", function () {
reload("main.css", {stream: true});
});
/**
* Watch for all other changes, reload the whole page
*/
gulp.watch(["src/**/*.jade", "src/**/*.json", "src/**/*.md"], function () {
reload();
});
})
});
/**
* Default task, running just `gulp` will compile the sass,
* compile the harp site, launch BrowserSync & watch files.
*/
gulp.task('default', ['serve']);
gulp.task('build-release', function (done) {
harp.compile('src', __dirname + '/dist', done);
});
gulp.task('publish', ['build-release'], function () {
return gulp.src("./dist/**/*")
.pipe(ghPages({
branch: "master",
cacheDir: ".publish"
}))
});