taunus / getting-started

Tutorial for Getting Started with Taunus
http://taunus.io/getting-started
8 stars 1 forks source link

Handlebars #1

Open radum opened 8 years ago

radum commented 8 years ago

How do you precompile Handlebars template to use them instead of Jade?

radum commented 8 years ago

Somehow answering my own question for others to find

I used gulp-handlebars like this:

gulp.task('views', () => {
    gulp.src(['views/**/*.hbs'])
        .pipe($.handlebars({
            handlebars: require('handlebars')
        }))
        .pipe($.defineModule('node'))
        .pipe(gulp.dest('.bin/views/'));
});
var routes = require('./controllers/routes');

taunusExpress(taunus, app, {
    routes: routes,
    layout: require('./.bin/views/layouts/main')
});