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

Already on GitHub? Sign in to your account

Autoload partials #246

TiddoLangerak opened this Issue Aug 16, 2012 · 2 comments


None yet
3 participants

It would be nice if we could autoload partials when they are requested, instead of having to supply them in advance. Especially when this implementation is used server side (e.g. with Node) this would be very useful. My suggestion is that the if the 3rd argument of the render function is a function, then it will be used as a callback function to load partials. E.g. (Node.js):

var Mustache = require("mustache");
Mustache.render(template, view, function (name) {
  var templateFile = fs.readFileSync(name + ".mustache");



mjackson commented Aug 31, 2012

This is an interesting idea. Let's track discussion on this in #247.

@mjackson mjackson closed this Aug 31, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment