Last active
December 22, 2015 12:42
-
-
Save naoyashiga/8a1f796ac5b936de1bef to your computer and use it in GitHub Desktop.
Bootstrap + Gulp + Jade Setting
This file contains hidden or 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
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass') | |
notify = require("gulp-notify") | |
bower = require('gulp-bower'), | |
jade = require('gulp-jade'), | |
webserver = require('gulp-webserver'); | |
var config = { | |
sassPath: './resources/sass', | |
jadePath: './resources/jade', | |
bowerDir: './bower_components' | |
} | |
gulp.task('server', function() { | |
gulp.src('public') | |
.pipe(webserver({ | |
livereload: true, | |
port: 8001, | |
fallback: 'index.html', | |
open: true | |
})); | |
}); | |
gulp.task('jade', function() { | |
return gulp.src(config.jadePath + "/index.jade") | |
.pipe( | |
jade({ | |
pretty: true | |
}) | |
) | |
.pipe(gulp.dest('public/')); | |
}); | |
gulp.task('bower', function() { | |
return bower() | |
.pipe(gulp.dest(config.bowerDir)) | |
}); | |
gulp.task('icons', function() { | |
return gulp.src(config.bowerDir + '/fontawesome/fonts/**.*') | |
.pipe(gulp.dest('./public/fonts')); | |
}); | |
gulp.task('css', function() { | |
return sass(config.sassPath + '/style.scss', { | |
style: 'compressed', | |
loadPath: [ | |
'./resources/sass', | |
config.bowerDir + '/bootstrap-sass-official/assets/stylesheets', | |
config.bowerDir + '/fontawesome/scss', | |
] | |
}) | |
.on("error", notify.onError(function (error) { | |
return "Error: " + error.message; | |
})) | |
.pipe(gulp.dest('./public/css')); | |
}); | |
// Rerun the task when a file changes | |
gulp.task('watch', function() { | |
gulp.watch(config.sassPath + '/**/*.scss', ['css']); | |
gulp.watch(config.jadePath + '/**/*.jade', ['jade']); | |
}); | |
gulp.task('default', ['watch','server']); |
This file contains hidden or 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
include mixins | |
doctype | |
html | |
head | |
title Sample | |
link(rel="stylesheet" href="css/style.css") | |
body | |
header | |
+navbar("Project name","dropdown_menu") | |
+nav_item("index.html","active") Home | |
+nav_item("about.html") About | |
+nav_item("contact.html") Contact | |
+nav_item_dropdown("#")(label="Dropdown") | |
+nav_item("#") Action | |
+nav_item("#") Another Action | |
+nav_item("#") Something else here | |
+nav_divider | |
+nav_header Nav header | |
+nav_item("#") Separated link | |
+nav_item("#") One more separated link | |
.container | |
.row | |
.col-md-4.col-sm-6.col-xs-12 | |
+panel("Panel Heading") We are a fairly small, xn needs. | |
.col-md-4.col-sm-6.col-xs-12 | |
+panel("Panel Heading","success") We are a fairly small, xn needs. | |
.col-md-4.col-sm-6.col-xs-12 | |
+panel("Panel Heading","danger") We are a fairly small, xn needs. | |
.row | |
.col-md-2.col-sm-6.col-xs-12 | |
+button hoge | |
+button("primary","#") Primary | |
+alert("warning") Warning! Warning! | |
.jumbotron | |
h1 uhhhhhh | |
p ajifjwijfpwi | |
p: +button("primary","#","large") More |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment