panini
panini copied to clipboard
Panini does not output pages with html extension when pages are .hbs
So looking at the gulpfile, the pages task the src accepts three different extensions, But when I save my pages as .hbs, panini keeps the .hbs extension in dist
is there something I'm missing?
return gulp.src('src/pages/**/*.{html,hbs,handlebars}')
.pipe(panini({
root: 'src/pages/',
layouts: 'src/layouts/',
partials: 'src/partials/',
data: 'src/data/',
helpers: 'src/helpers/'
}))
.pipe(gulp.dest(PATHS.dist));
}```
A workaround I found is:
-
Install a Gulp plugin which will change the extension of all your files:
npm install gulp-ext-replace --save-dev
(NPM link) -
Add it to the top of your gulpfile:
var ext_replace = require('gulp-ext-replace');
- Update your Gulp task:
gulp.task('default', function () {
return gulp.src('src/pages/**/*.{html,hbs,handlebars}')
.pipe(panini({
root: 'src/pages/',
layouts: 'src/layouts/',
partials: 'src/partials/',
data: 'src/data/',
helpers: 'src/helpers/'
}))
.pipe(ext_replace('.html')) // <-- this will rename all your output files to `.html`
.pipe(gulp.dest(PATHS.dist));
})
Yeah, that's what I did in the end. But it's still a bug I think?
It is indeed a bug. I'll take a PR if someone wants to write one 👌
It is indeed a bug. I'll take a PR if someone wants to write one
It would be cool to have all files in handlebars format in panini js