shannonmoeller / handlebars-wax

The missing Handlebars API for data, partials, helpers, and decorators.
http://npm.im/handlebars-wax
MIT License
40 stars 9 forks source link

Unable to use arbitrary extensions for partials #13

Closed fidian closed 7 years ago

fidian commented 7 years ago

I'm trying to load handlebar partials into both metalsmith-layouts and metalsmith-hbt-md because I first process markdown as mustache, then convert to HTML, then insert into the layout which is also mustache.

It appears that you're using require(partialFilename). When it's HTML, I get the following error:

/home/user/project/layout/partials/content.html:1
(function (exports, require, module, __filename, __dirname) { <div class="D(tbc) W(100%)">

HTML isn't valid JS, so the cause of the error is obvious. Can arbitrary extensions be made to work?

shannonmoeller commented 7 years ago

I've added an extensions option which now defaults to ['.handlebars', '.hbs', '.html']. Released as v6.0.0.

fidian commented 7 years ago

Wow, thanks for that amazingly fast turnaround!!