about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-12-06 17:42:16 -0500
committerGitHub <noreply@github.com>2019-12-06 17:42:16 -0500
commitc1bb2e70e0a85227df899eccc6ac8cf661afe350 (patch)
treea12f43e34e0d32e68f0a14c9512b2b08af54829b /scripts
parentfaaf63ad895bd51541a9984273d52c71645a0b28 (diff)
parentc7306cfdbaa50c89639fe38bb1b4005ed3555422 (diff)
downloadpuszcza-c1bb2e70e0a85227df899eccc6ac8cf661afe350.tar.gz
puszcza-c1bb2e70e0a85227df899eccc6ac8cf661afe350.zip
Merge pull request #14 from 19pdh/develop
Storybook and license
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generateApi.js7
-rwxr-xr-xscripts/postbuild.sh1
2 files changed, 6 insertions, 2 deletions
diff --git a/scripts/generateApi.js b/scripts/generateApi.js
index f72745e..4b7426a 100755
--- a/scripts/generateApi.js
+++ b/scripts/generateApi.js
@@ -15,9 +15,12 @@ posts = posts.map(({ date, title, content, 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('./static/api/posts.json', JSON.stringify(posts), err =>
+  err ? console.log(err) : null
+)
+
 console.log(posts)
diff --git a/scripts/postbuild.sh b/scripts/postbuild.sh
index 85e35f9..6da3659 100755
--- a/scripts/postbuild.sh
+++ b/scripts/postbuild.sh
@@ -1,6 +1,7 @@
 #!/usr/bin/env bash
 
 mkdir ./dist/api
+mkdir ./static/api
 
 node -r esm ./scripts/generateApi.js