diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/generateApi.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/generateApi.js b/scripts/generateApi.js index 27af063..128387c 100755 --- a/scripts/generateApi.js +++ b/scripts/generateApi.js @@ -4,16 +4,18 @@ let { getPosts } = require('../api/api') let posts = getPosts() -posts = posts.map(({ year, month, day, title, attributes, route }) => { - return { - date: `${year}-${month}-${day}`, - title, - attributes, - route - } +posts = posts.map(({ year, month, day, title, data, route }) => { + return { + date: `${year}-${month}-${day}`, + title, + data, + route + } }) posts.sort((a, b) => (a.route > b.route ? 1 : -1)) -fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), (err) => err ? console.log(err) : null) +fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), err => + err ? console.log(err) : null +) console.log(posts) |