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.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/generateApi.js b/scripts/generateApi.js
index 128387c..f72745e 100755
--- a/scripts/generateApi.js
+++ b/scripts/generateApi.js
@@ -1,14 +1,16 @@
-const fs = require('fs')
+import fs from 'fs'
+import k from '../api'
 
-let { getPosts } = require('../api/api')
+let posts = k.getPosts()
 
-let posts = getPosts()
+posts = posts.map(({ date, title, content, route }) => {
+  const { year, month, day } = date
+  const { description, meta } = content
 
-posts = posts.map(({ year, month, day, title, data, route }) => {
   return {
     date: `${year}-${month}-${day}`,
     title,
-    data,
+    content: { description, meta },
     route
   }
 })