Last active
July 20, 2016 21:56
-
-
Save paulojeronimo/655b9c672e7f931b8c16ec4448bbe578 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# | |
mkdir prototipo && cd $_ | |
# | |
#echo '{}' > package.json | |
npm init -y | |
# | |
npm i -D gulp gulp-jade | |
# | |
cat > bowser.json <<EOF | |
{ "name": "`basename $PWD`" } | |
EOF | |
# | |
bower i bootstrap jquery --save | |
# | |
d=src/templates && mkdir -p $d | |
# | |
cat > $d/index.jade<<'EOF' | |
doctype html | |
html(lang='en') | |
head | |
meta(charset='utf-8') | |
meta(http-equiv='X-UA-Compatible', content='IE=edge') | |
meta(name='viewport', content='width=device-width, initial-scale=1') | |
title Template | |
link(href='css/bootstrap.min.css', rel='stylesheet') | |
body | |
h1 Hello, world! | |
script(src='js/jquery.min.js') | |
script(src='js/bootstrap.min.js') | |
EOF | |
# | |
tree src | |
cat > gulpfile.js <<'EOF' | |
var gulp = require('gulp'), | |
jade = require('gulp-jade'); | |
gulp.task('jade', function() { | |
return gulp | |
.src('src/templates/**/*.jade') | |
.pipe(jade()) | |
.pipe(gulp.dest('build/development')); | |
}); | |
EOF | |
# | |
gulp jade | |
cat > gulpfile.js<<'EOF' | |
var gulp = require('gulp'), | |
jade = require('gulp-jade'); | |
gulp.task('jade', function() { | |
gulp.src('src/templates/**/*.jade') | |
.pipe(jade()) | |
.pipe(gulp.dest('build/development')); | |
}); | |
gulp.task('copy-assets', function() { | |
gulp.src('bower_components/bootstrap/dist/css/bootstrap.min.css') | |
.pipe(gulp.dest('build/development/css')); | |
}); | |
gulp.task('default', ['jade', 'copy-assets'], function() { | |
}); | |
EOF | |
gulp | |
npm -i g http-server | |
(cd build/development && http-server) | |
# Links .. | |
# http://html2jade.org/ | |
# https://github.com/donpark/html2jade | |
# https://www.codementor.io/development-process/tutorial/how-to-set-up-gulp-beginner-guide | |
# https://www.youtube.com/playlist?list=PLHrxuCR-0CcSWiMuLf58iuIsNlP549-Sk | |
# http://ilikekillnerds.com/2014/07/copying-files-from-one-folder-to-another-in-gulp-js/ | |
# http://blog.andrewray.me/how-to-copy-only-changed-files-with-gulp/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment