Created
June 12, 2014 20:14
-
-
Save doowb/1a3caa92711120f733cf to your computer and use it in GitHub Desktop.
Generate a bunch of pages
This file contains hidden or 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 file = require('fs-utils'); | |
var matter = require('gray-matter'); | |
var max = 10000; | |
var i = 0; | |
var obj = matter.read('src/templates/pages/index.hbs'); | |
var str = obj.original; | |
for (i=1; i <= max; i++) { | |
file.writeFileSync('src/templates/pages/page_' + i + '.hbs', matter.reconstruct(str, {message: 'This is page number ' + i})); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment