gulp-assemble icon indicating copy to clipboard operation
gulp-assemble copied to clipboard

Issue with multiple files with same name

Open brandonmerritt opened this issue 10 years ago • 2 comments

| src |subfolder |____foo.hbs |__subfolder2 |____foo.hbs |

gulp.task('convert-hbs', function(){
  return gulp.src('./src/**/*.hbs')
    .pipe(gulpAssemble(assemble, {layout: 'default'}))
    .pipe(gulp.dest(paths.build));
});

only renders "subfolder2 > foo.html". If give the files unique names they are both rendered.

brandonmerritt avatar Jun 11 '15 19:06 brandonmerritt

try using

assemble.option('renameKey', function(fp) {
  // whatever logic you need for renaming template keys
  return fp;
});

there are a few other issues about this already. object keys must be unique in javascript - we've considered using an id for lookups, or full filepaths, but that also effects how partials are used, or how templates reference one another.

we are about to release some improvements to renameKey, in the meantime any ideas are very welcome. we'd love to improve this

jonschlinkert avatar Jun 12 '15 01:06 jonschlinkert

Thanks. I was renaming them prior to running them through Assemble. This will help!

brandonmerritt avatar Jun 16 '15 17:06 brandonmerritt