diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/getPosts.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/getPosts.ts b/lib/getPosts.ts index 814f6d8..a8b4fe9 100644 --- a/lib/getPosts.ts +++ b/lib/getPosts.ts @@ -9,7 +9,8 @@ function getPosts(path: string): Array<Post> { months.forEach((month: string) => { const days = readDir(`${path}/${year}/${month}`).reverse(); days.forEach((day: string) => { - const files = readDir(`${path}/${year}/${month}/${day}`).reverse(); + let files = readDir(`${path}/${year}/${month}/${day}`).reverse(); + files = files.filter((file: string) => file.substr(file.length - 2) === "md"); files.forEach((file: string) => { const fsRoute = `${path}/${year}/${month}/${day}/${file}`; try { |