Skip to content

Commit

Permalink
test pug
Browse files Browse the repository at this point in the history
  • Loading branch information
badoubadou committed Jul 24, 2018
1 parent e5f8320 commit bdff8ab
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.anvil
.DS_Store
.idea/
2 changes: 1 addition & 1 deletion assets/pug/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ html(lang='en')
body
h1 Pug Examples
div.container
p O yeah it's fucking working !
p O yeah it's fucking working ! Boom
48 changes: 25 additions & 23 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,43 @@ var stylus = require('gulp-stylus');
var pug = require('gulp-pug');

gulp.task('javascript', function() {
return gulp.src('assets/javascript/*.js')
.pipe(wrap('(function($, window){<%= contents %>}(jQuery, window));'))
.pipe(rename({
suffix: '.min'
}))
.pipe(uglify())
.pipe(gulp.dest('public/javascripts'))
.pipe(notify({ message: 'Scripts task complete' }));
return gulp.src('assets/javascript/*.js')
.pipe(wrap('(function($, window){<%= contents %>}(jQuery, window));'))
.pipe(rename({
suffix: '.min'
}))
.pipe(uglify())
.pipe(gulp.dest('public/javascripts'))
.pipe(notify({ message: 'Scripts task complete' }));
});

gulp.task('css', function() {
return gulp.src('assets/style/*.styl')
.pipe(stylus({
use: nib(),
compress: true
}))
.pipe(gulp.dest('public/stylesheets'))
.pipe(notify({ message: 'CSS task complete' }));
return gulp.src('assets/style/*.styl')
.pipe(stylus({
use: nib(),
compress: true
}))
.pipe(gulp.dest('public/stylesheets'))
.pipe(notify({ message: 'CSS task complete' }));
});

gulp.task('pug', function buildHTML() {
return gulp.src('assets/pug/*.pug')
.pipe(pug({
// Your options in here.
}))
.pipe(gulp.dest('public/'))
return gulp.src('assets/pug/*.pug')
.pipe(pug({
// Your options in here.
}))
.pipe(gulp.dest('public/'))
});

gulp.task('default', function() {
gulp.start('javascript');
gulp.start('pug');
gulp.start('javascript');
gulp.start('pug');
gulp.start('css');
gulp.start('watch');
});

gulp.task('watch', function() {
gulp.watch('assets/javascript/*.js', ['javascript']);
gulp.watch('assets/javascript/*.js', ['javascript']);
gulp.watch('assets/style/*.styl', ['css']);
gulp.watch('assets/pug/*.pug', ['pug']);
});
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html ><html lang="en"> <head><title>Pug</title></head><body><h1>Pug Examples</h1><div class="container"><p>O yeah it's fucking working !</p></div></body></html>
<!DOCTYPE html ><html lang="en"> <head><title>Pug</title></head><body><h1>Pug Examples</h1><div class="container"><p>O yeah it's fucking working ! Boom</p></div></body></html>

0 comments on commit bdff8ab

Please sign in to comment.