Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TeriyakiBomb opened this issue Jun 1, 2018 · 4 comments
Open

Comments

@TeriyakiBomb
Copy link

TeriyakiBomb commented Jun 1, 2018

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
Copy link

nwittwer commented Oct 1, 2018

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');
  1. 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
Copy link
Author

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

@gakimball
Copy link
Contributor

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

@webdevyriy
Copy link

webdevyriy commented Apr 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants