Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fffadc7
commit f1b5a3a
Showing
10 changed files
with
98 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
paginate: 8 | ||
exclude: | ||
- README.md | ||
- gulp | ||
- .gitignore | ||
- bower_components | ||
- node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
gulp = require("gulp") | ||
|
||
gulp.task "bootstrap", -> | ||
bowerSrc = __dirname + "/../bower_components" | ||
bootstrapSrc = bowerSrc + "/bootstrap" | ||
|
||
gulp.src(bootstrapSrc + "/fonts/**") | ||
.pipe gulp.dest("build/fonts") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
gulp = require('gulp') | ||
|
||
gulp.task "build", -> | ||
gulp.src("build/css/**") | ||
.pipe gulp.dest("_site/build/css") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# All the gulp tasks | ||
|
||
require("./less") | ||
require("./bootstrap") | ||
require("./server") | ||
require("./build") | ||
require("./watch") | ||
require("./jekyll") | ||
|
||
gulp = require('gulp') | ||
|
||
gulp.task('default', ['less', 'bootstrap', 'jekyll', 'build']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
child_process = require('child_process') | ||
gulp = require('gulp') | ||
|
||
gulp.task "jekyll", (next) -> | ||
opts = [ | ||
"build" | ||
"--config" | ||
"_config.yml,_test.yml" | ||
] | ||
require("child_process").spawn("jekyll", opts, stdio: "inherit") | ||
.on('close', -> next() ) | ||
.on('error', (err) -> next(err) ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
_ = require('underscore') | ||
gulp = require('gulp') | ||
gutil = require('gulp-util') | ||
less = require('gulp-less') | ||
|
||
gulp.task "less", -> | ||
bowerSrc = __dirname + "/../bower_components" | ||
|
||
# set up some paths for less to import from | ||
paths = [ | ||
__dirname + "/../less" | ||
bowerSrc + "/bootstrap/less" | ||
bowerSrc + "/lesshat/build" | ||
] | ||
|
||
gulp.src("less/*.less") | ||
.pipe(less(paths: paths)) | ||
.on("error", gutil.log) | ||
.pipe gulp.dest("build/css") | ||
|
||
gulp.src("less/*.css") | ||
.pipe gulp.dest("build/css") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
gulp = require('gulp') | ||
express = require('express') | ||
|
||
gulp.task "server", ["watch"], (next) -> | ||
app = new express() | ||
|
||
#app.use(new express.logger()); | ||
app.use new express.static(__dirname + "/_site") | ||
app.listen 4000, next | ||
console.log "listening on port 4000" | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
gulp = require("gulp") | ||
livereload = require('gulp-livereload') | ||
|
||
server = null | ||
|
||
gulp.task "watch", ["default"], -> | ||
server ?= livereload() | ||
|
||
gulp.watch "less/**", ["less"] | ||
gulp.watch "build/**", ["copy-build"] | ||
gulp.watch [ | ||
"index.html" | ||
"_posts/**" | ||
"_includes/**" | ||
"_layouts/**" | ||
"portfolio/**" | ||
], ["jekyll"] | ||
gulp.watch "_site/**", (file) -> | ||
server.changed file.path | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,4 @@ | ||
var gulp = require('gulp'); | ||
var gutil = require('gulp-util'); | ||
var less = require('gulp-less'); | ||
var livereload = require('gulp-livereload'); | ||
var watch = require('gulp-watch'); | ||
var express = require('express'); | ||
var _ = require('underscore'); | ||
// managed using coffeescript in gulp submodule | ||
require('coffee-script').register(); | ||
|
||
var bowerSrc = __dirname + '/bower_components'; | ||
var bootstrapSrc = bowerSrc + '/bootstrap'; | ||
var lesshatSrc = bowerSrc + '/lesshat'; | ||
var server = livereload(); | ||
|
||
gulp.task('less', _.debounce(function() { | ||
// set up some paths for less to import from | ||
var paths = []; | ||
paths.push(__dirname + '/less'); | ||
paths.push(bootstrapSrc + '/less'); | ||
paths.push(lesshatSrc + '/build'); | ||
|
||
gulp.src('less/*.less') | ||
.pipe(less({paths:paths})) | ||
.on('error', gutil.log) | ||
.pipe(gulp.dest('build/css')); | ||
|
||
gulp.src('less/*.css') | ||
.pipe(gulp.dest('build/css')); | ||
|
||
}, 200)); | ||
|
||
gulp.task('bootstrap', _.debounce(function() { | ||
gulp.src(bootstrapSrc + '/fonts/**') | ||
.pipe(gulp.dest('build/fonts')); | ||
}, 200)); | ||
|
||
gulp.task('jekyll', _.debounce(function(next) { | ||
return require('child_process').spawn('jekyll', ['build', '--config', '_config.yml,_test.yml'], {stdio: 'inherit'}); | ||
}, 400)); | ||
|
||
gulp.task('server', ['watch'], function(next) { | ||
var app = new express(); | ||
//app.use(new express.logger()); | ||
app.use(new express.static(__dirname + '/_site')); | ||
app.listen(4000, next); | ||
console.log("listening on port 4000"); | ||
}); | ||
|
||
gulp.task('copy-build', _.debounce(function() { | ||
gulp.src('build/css/**') | ||
.pipe(gulp.dest('_site/build/css')); | ||
}, 200)); | ||
|
||
gulp.task('default', ['less', 'bootstrap', 'jekyll', 'copy-build']); | ||
|
||
gulp.task('watch', ['default'], function() { | ||
gulp.watch('less/**', ['less']); | ||
gulp.watch('build/**', ['copy-build']); | ||
gulp.watch([ | ||
'index.html', | ||
'_posts/**', | ||
'_includes/**', | ||
'_layouts/**', | ||
'portfolio/**', | ||
], ['jekyll']); | ||
gulp.watch('_site/**', function(file) { | ||
server.changed(file.path); | ||
}); | ||
}); | ||
require('./gulp'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters