Skip to content

Instantly share code, notes, and snippets.

@stephenmathieson
Created January 7, 2014 16:08
Show Gist options
  • Save stephenmathieson/8301619 to your computer and use it in GitHub Desktop.
Save stephenmathieson/8301619 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var read = fs.readFileSync;
var write = fs.writeFileSync;
var jade = require('jade');
var people = require('./people.json');
var template = jade.compile(read('./person.jade', 'utf8'));
people.forEach(function (person) {
var html = template({
person: person
});
write('./' + person.name + '.html', html);
});
[
{
"name": "Bill",
"description": "Bill is really fucking awesome"
},
{
"name": "Sally",
"description": "Sally is kind cool"
}
]
h1 #{person.name}'s Profile
p #{person.description}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment