about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-01-29 12:22:09 +0100
committerGitHub <noreply@github.com>2020-01-29 12:22:09 +0100
commit3e5f329cd8c9692e24f5fd56a5e4189bf2202e0d (patch)
tree8f9140f2326df571a6990df6e9cbd1525f19e374 /scripts
parent3c2ac6715dfffc2eda38e014ed0b4986ccc7f75a (diff)
parent0a8355312990db95de3aa4e946b907ed0abf5a12 (diff)
downloadpuszcza-3e5f329cd8c9692e24f5fd56a5e4189bf2202e0d.tar.gz
puszcza-3e5f329cd8c9692e24f5fd56a5e4189bf2202e0d.zip
Merge pull request #26 from 19pdh/feature/json-api
Feature/json api
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generateApi.js26
-rwxr-xr-xscripts/postbuild.sh7
2 files changed, 0 insertions, 33 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)
diff --git a/scripts/postbuild.sh b/scripts/postbuild.sh
deleted file mode 100755
index 6da3659..0000000
--- a/scripts/postbuild.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-
-mkdir ./dist/api
-mkdir ./static/api
-
-node -r esm ./scripts/generateApi.js
-