diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-14 10:03:47 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-14 10:03:47 +0200 |
commit | d400b53bee9ba563810171c217710d4176b7c367 (patch) | |
tree | 49f339a0c05a51fedcf4d741d9828f63ab0046d3 /scripts/generateApi.js | |
parent | 5cfbd5b71d149419b0b80056e652ca94d26f1a95 (diff) | |
download | puszcza-d400b53bee9ba563810171c217710d4176b7c367.tar.gz puszcza-d400b53bee9ba563810171c217710d4176b7c367.zip |
Add kronikarz
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 } }) |