Skip to content

Instantly share code, notes, and snippets.

@jdavisclark
Created January 10, 2012 05:43
Show Gist options
  • Save jdavisclark/1587248 to your computer and use it in GitHub Desktop.
Save jdavisclark/1587248 to your computer and use it in GitHub Desktop.
alternate bogart viewengine signature
var bogart = require('bogart')
, jade = require('jade');
require('bogart').viewEngine.addEngine('jade', function(path, opts, read, cache) {
when(cache(path) || read(path), function(tpl) {
var fn;
if(typeof tpl === "function") {
fn = tpl;
} else {
fn = jade.compile(tpl, opts);
cache(path, fn);
}
return fn(opts.locals);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment