foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

Panini does not output pages with html extension when pages are .hbs #171

Open TeriyakiBomb opened 6 years ago

TeriyakiBomb commented 6 years ago

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));
}```
nwittwer commented 6 years ago

A workaround I found is:

  1. Install a Gulp plugin which will change the extension of all your files: npm install gulp-ext-replace --save-dev (NPM link)

  2. Add it to the top of your gulpfile:

    var ext_replace = require('gulp-ext-replace');
  3. 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));
    })
TeriyakiBomb commented 6 years ago

Yeah, that's what I did in the end. But it's still a bug I think?

gakimball commented 5 years ago

It is indeed a bug. I'll take a PR if someone wants to write one 👌

webdevyriy commented 4 years ago

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