summary refs log tree commit diff
path: root/lib/getPosts.ts
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-01-28 11:55:03 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-01-28 11:55:03 +0100
commit9f75ff1d2d5ebf34c040474e836e125f80253365 (patch)
tree523c52b9dd158e21d9247b58d81c655102323a26 /lib/getPosts.ts
parentc11d7a84aa59e9b1179a9834129b2d776bab8bca (diff)
downloadkronikarz-9f75ff1d2d5ebf34c040474e836e125f80253365.tar.gz
kronikarz-9f75ff1d2d5ebf34c040474e836e125f80253365.zip
Add Post class
Diffstat (limited to 'lib/getPosts.ts')
-rw-r--r--lib/getPosts.ts5
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);