diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-28 11:55:03 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-28 11:55:03 +0100 |
commit | 9f75ff1d2d5ebf34c040474e836e125f80253365 (patch) | |
tree | 523c52b9dd158e21d9247b58d81c655102323a26 /lib/getPosts.ts | |
parent | c11d7a84aa59e9b1179a9834129b2d776bab8bca (diff) | |
download | kronikarz-9f75ff1d2d5ebf34c040474e836e125f80253365.tar.gz kronikarz-9f75ff1d2d5ebf34c040474e836e125f80253365.zip |
Add Post class
Diffstat (limited to 'lib/getPosts.ts')
-rw-r--r-- | lib/getPosts.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/getPosts.ts b/lib/getPosts.ts index c363c67..814f6d8 100644 --- a/lib/getPosts.ts +++ b/lib/getPosts.ts @@ -1,5 +1,4 @@ -import { Post } from "./interfaces"; -import { parsePost } from "./parsePost"; +import Post from "./Post"; import { readDir } from "./utils"; function getPosts(path: string): Array<Post> { @@ -14,7 +13,7 @@ function getPosts(path: string): Array<Post> { files.forEach((file: string) => { const fsRoute = `${path}/${year}/${month}/${day}/${file}`; try { - const post = parsePost(fsRoute); + const post = new Post(fsRoute); routesArray.push(post); } catch (err) { console.log(err); |