From 9f75ff1d2d5ebf34c040474e836e125f80253365 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Tue, 28 Jan 2020 11:55:03 +0100 Subject: Add Post class --- lib/getPosts.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/getPosts.ts') 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 { @@ -14,7 +13,7 @@ function getPosts(path: string): Array { 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); -- cgit 1.4.1