shannonmoeller / gulp-hb

A sane Gulp plugin to compile Handlebars templates. Useful as a static site generator.
http://npm.im/gulp-hb
MIT License
147 stars 14 forks source link

We need have *.hbs for input but *.html at output #37

Closed ryuran closed 8 years ago

ryuran commented 8 years ago

Hello,

It's can be a stupid question but. How to change extension from src file to dest (.hbs to .html) ?

Thanks

shannonmoeller commented 8 years ago

Sure thing! You're looking for gulp-rename. You can use it before or after gulp-hb to change the extensions. I like to put it close to the gulp.dest when I can.

var gulp = require('gulp');
var hb = require('gulp-hb');
var rename = require('gulp-rename');

gulp.src('src/**/*.hbs')
    .pipe(hb())
    .pipe(rename({ extname: '.html' })
    .pipe(gulp.dest('dest'))
ryuran commented 8 years ago

Thank you for your answers. I use gulp-rename and it's works.