queckezz / koa-views

Template rendering middleware for koa (hbs, swig, pug, anything! :sparkles:)
MIT License
710 stars 87 forks source link

make partials in handlebars work regular (#77) #85

Closed wsmPanda closed 7 years ago

wsmPanda commented 7 years ago

copy options.partials to state.partials
to avoid partials object be modified ,which make hbs partials render error after code var state = Object.assign(locals, options, ctx.state || {})

int64ago commented 7 years ago

The "trick" of this PR seems like a right fix, for consolidate.js does a wrong way in partials cache(and I don't think it'll be fixed easily), it modified options.partials[] from file path to the content of the file.

Then, I prefer to accept this PR but the code style should be in the right way. #81 #77

int64ago commented 7 years ago

edd8e6f27cafb317418c0fd8619b69e6390bfe28