diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-14 09:47:28 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-14 09:47:51 +0200 |
commit | 49e82e812812ba75175d98173379d2e416e17b8f (patch) | |
tree | f67bdcffce9aca8a76b534124a0eabbe85658768 /lib/parsePost.ts | |
parent | 262ebdc07892f3c892d4831c276444df6f6e22f1 (diff) | |
download | kronikarz-49e82e812812ba75175d98173379d2e416e17b8f.tar.gz kronikarz-49e82e812812ba75175d98173379d2e416e17b8f.zip |
Add getPost
Diffstat (limited to 'lib/parsePost.ts')
-rw-r--r-- | lib/parsePost.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/parsePost.ts b/lib/parsePost.ts index 01e8d1c..416dd16 100644 --- a/lib/parsePost.ts +++ b/lib/parsePost.ts @@ -29,7 +29,7 @@ function getPostContent(fileContent: string): PostContent { }; } -export default function parsePost(filePath: string): Post { +export function parsePost(filePath: string): Post { const [year, month, day, title] = filePath.split("/").splice(-4, 4); const date = { year, month, day }; const fileContent = fs.readFileSync(filePath, "utf-8"); |