diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-06-25 22:40:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 22:40:20 +0200 |
commit | 0370cfa8981741bcb7570568ecfcf8f0f2b5fd21 (patch) | |
tree | 61c694e0719ee7d98777058ac8bf334c07c3d6b9 | |
parent | ac2b643c386e89cf806d4217c4b68119a0c6637b (diff) | |
download | kronikarz-0370cfa8981741bcb7570568ecfcf8f0f2b5fd21.tar.gz kronikarz-0370cfa8981741bcb7570568ecfcf8f0f2b5fd21.zip |
Check whole extension
-rw-r--r-- | lib/getPosts.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/getPosts.ts b/lib/getPosts.ts index a8b4fe9..058d96d 100644 --- a/lib/getPosts.ts +++ b/lib/getPosts.ts @@ -10,7 +10,7 @@ function getPosts(path: string): Array<Post> { const days = readDir(`${path}/${year}/${month}`).reverse(); days.forEach((day: string) => { let files = readDir(`${path}/${year}/${month}/${day}`).reverse(); - files = files.filter((file: string) => file.substr(file.length - 2) === "md"); + files = files.filter((file: string) => file.substr(file.length - 3) === ".md"); files.forEach((file: string) => { const fsRoute = `${path}/${year}/${month}/${day}/${file}`; try { |