From 0370cfa8981741bcb7570568ecfcf8f0f2b5fd21 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Thu, 25 Jun 2020 22:40:20 +0200 Subject: Check whole extension --- lib/getPosts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 { 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 { -- cgit 1.4.1