diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-17 21:08:25 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-17 21:08:25 +0200 |
commit | edb6cb5adc69c8f2131b7b309d91a53e21af2486 (patch) | |
tree | 0387b78df50fbb69ef0b597d2dcdfc4913c337a5 /scripts/generateApi.js | |
parent | e81210cefcc34cd68f1a49c0f8146e08ffd01c24 (diff) | |
download | puszcza-edb6cb5adc69c8f2131b7b309d91a53e21af2486.tar.gz puszcza-edb6cb5adc69c8f2131b7b309d91a53e21af2486.zip |
Revert "Revert "Add kronikarz""
This reverts commit 4fe5fef70b111ab0e10d91ee7060302a52ca3b76.
Diffstat (limited to 'scripts/generateApi.js')
-rwxr-xr-x | scripts/generateApi.js | 12 |
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 } }) |