Closed AndersDJohnson closed 10 years ago
We pass in a string in assemble here.
What's not working? In any case, I think handlebars is compiling it in the register function so this code probably isn't needed.
I think there might be another bug in assemble that is conflicting here. I'm working on tracking it down now.
Actually, they don't compile it first. It might be a good idea to remove it anyway and I was thinking about this when doing the layout helpers. I thought there might be a conflict with those and assemble, but hadn't had the time to test it yet. I think this can still be a good PR since it leaves the partials as strings throughout the entire process.
@doowb Getting this error from Handlebars core: You must pass a string or Handlebars AST to Handlebars.compile
.
If they don't pre-compile, this would be a performance hit. I can look into it further if we're hesitant to merge this.
I'm good with merging this, but let's make sure we test it against real code first and make sure there are no breaking changes. also, I think a bug was created between 0.4.9 and 0.4.10 that might be related, perhaps not, but it's worth a look.
As @doowb (https://github.com/assemble/assemble/pull/354#issuecomment-26230385) and I have discovered, this appears to be necessary to support loading layouts as partials in the options.partials
config.
@adjohnson916 no prob, I'm following
btw, @adjohnson916 "loading layouts as partials" specifically refers to this pr https://github.com/assemble/handlebars-helpers/pull/75, correct? If so I think we just need to get the features mentioned in https://github.com/assemble/handlebars-helpers/issues/16 implemented then we're good to merge it, so we're not messing with it too much after people are using it.
@jonschlinkert Correct.
@adjohnson916 Will you remove the var tmpl;
on the first line of this function and commit it? Then I'll merge this in and bump this repo.
@doowb Done.
Unless you have a working use case for passing a string template... it isn't working for me.