Skip to content

Instantly share code, notes, and snippets.

@cfurrow
Created November 14, 2010 23:35
Show Gist options
  • Save cfurrow/676229 to your computer and use it in GitHub Desktop.
Save cfurrow/676229 to your computer and use it in GitHub Desktop.
var Haml = require('haml');
exports.templates = {};
var fs = require('fs');
function createTemplate(filename){
var haml = fs.readFileSync(filename,'utf8');
return Haml(haml);
}
exports.templates['item'] = createTemplate('./views/_item.haml');
exports.templates['edit_item'] = createTemplate('./views/_edit_item.haml');
exports.templates['new_item'] = createTemplate('./views/_new_item.haml');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment