Skip to content

Instantly share code, notes, and snippets.

@ramblex
Created March 12, 2011 01:04
Show Gist options
  • Save ramblex/866888 to your computer and use it in GitHub Desktop.
Save ramblex/866888 to your computer and use it in GitHub Desktop.
Using haml for express views
var haml = require('haml');
/*
* Register .haml so that markdown complies with express view system by
* implementing a compile method
*/
app.register('.haml', {
compile: function(str, options) {
return function(locals) {
return haml.render(str, {locals: locals});
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment