Created
January 7, 2014 16:08
-
-
Save stephenmathieson/8301619 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Bill", | |
"description": "Bill is really fucking awesome" | |
}, | |
{ | |
"name": "Sally", | |
"description": "Sally is kind cool" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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