Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Created June 30, 2013 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiggliemon/5893412 to your computer and use it in GitHub Desktop.
Save jiggliemon/5893412 to your computer and use it in GitHub Desktop.
var block = require('yayo/block')
var fs = require('fs')
function getTemplate(name) {
return fs.readFileSync('./tmpl/'+name+'.tmpl', 'utf8')
}
var layout = new block({
template: getTemplate('layout')
})
var header = new block({
template: getTemplate('header'),
id: "header"
})
var footer = new block({
template: getTemplate('footer'),
id:"footer"
})
layout.setBlock(header)
layout.setBlock(footer)
console.log(String(layout))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment