diff options
Diffstat (limited to 'scripts/generateApi.js')
-rwxr-xr-x | scripts/generateApi.js | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/scripts/generateApi.js b/scripts/generateApi.js deleted file mode 100755 index 4b7426a..0000000 --- a/scripts/generateApi.js +++ /dev/null @@ -1,26 +0,0 @@ -import fs from 'fs' -import k from '../api' - -let posts = k.getPosts() - -posts = posts.map(({ date, title, content, route }) => { - const { year, month, day } = date - const { description, meta } = content - - return { - date: `${year}-${month}-${day}`, - title, - content: { description, meta }, - route - } -}) - -fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), err => - err ? console.log(err) : null -) - -fs.writeFile('./static/api/posts.json', JSON.stringify(posts), err => - err ? console.log(err) : null -) - -console.log(posts) |