diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-29 12:31:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-29 12:31:13 +0100 |
commit | b424c1ce5573f72e36fcca00ef22e4b2f3dde9ff (patch) | |
tree | ff1d1de74e1b165a36d7804a49a3692e6cbea289 /api | |
parent | 13c55f4d5fca3e3452317322e387f75e0690f9c8 (diff) | |
parent | 3e5f329cd8c9692e24f5fd56a5e4189bf2202e0d (diff) | |
download | puszcza-b424c1ce5573f72e36fcca00ef22e4b2f3dde9ff.tar.gz puszcza-b424c1ce5573f72e36fcca00ef22e4b2f3dde9ff.zip |
Merge pull request #27 from 19pdh/develop
Develop
Diffstat (limited to 'api')
-rw-r--r-- | api/index.js | 15 | ||||
-rw-r--r-- | api/kronikarz.js | 7 |
2 files changed, 16 insertions, 6 deletions
diff --git a/api/index.js b/api/index.js index 5658365..7843302 100644 --- a/api/index.js +++ b/api/index.js @@ -1,7 +1,10 @@ -import Kronikarz from 'kronikarz' +export const apiUrl = 'https://puszcza.netlify.com/api' -const POSTS_PATH = './content/wpisy' - -const k = new Kronikarz(POSTS_PATH) - -export default k +export const parsePosts = (posts) => + posts.map((post) => ({ + title: post.title, + image: post.image, + description: post.description, + route: post.path, + meta: post.meta, + })) diff --git a/api/kronikarz.js b/api/kronikarz.js new file mode 100644 index 0000000..5658365 --- /dev/null +++ b/api/kronikarz.js @@ -0,0 +1,7 @@ +import Kronikarz from 'kronikarz' + +const POSTS_PATH = './content/wpisy' + +const k = new Kronikarz(POSTS_PATH) + +export default k |