about summary refs log tree commit diff
path: root/scripts/generateApi.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/generateApi.js')
-rwxr-xr-xscripts/generateApi.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/generateApi.js b/scripts/generateApi.js
index f439252..82bd583 100755
--- a/scripts/generateApi.js
+++ b/scripts/generateApi.js
@@ -1,13 +1,17 @@
+const fs = require('fs')
+
 let { getPosts } = require('../api/api')
 
 let posts = getPosts()
 
-posts = posts.map(({ year, month, day, title, route }) => {
+posts = posts.map(({ year, month, day, title, attributes, route }) => {
     return {
         date: `${year}-${month}-${day}`,
         title,
+        attributes,
         route
     }
 })
 
-console.log(posts)
\ No newline at end of file
+fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), (err) => err ? console.log(err) : null)
+console.log(posts)