summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-06-25 20:43:00 +0000
committerGitHub <noreply@github.com>2020-06-25 20:43:00 +0000
commitcf8a99205c40771c0081787ab662bb07de0ba257 (patch)
tree613d944505a852379d8cca65e50590a176a8c56a
parent0cc2a8a427d82ca43f11dcd76f60593cb1074e50 (diff)
parent8e4e6449afc898fec923d72eeeac2b64d559c4c8 (diff)
downloadkronikarz-cf8a99205c40771c0081787ab662bb07de0ba257.tar.gz
kronikarz-cf8a99205c40771c0081787ab662bb07de0ba257.zip
Merge pull request #12 from pniedzwiedzinski/file-extension v2.0.2
File extension
-rw-r--r--lib/getPosts.ts3
-rw-r--r--package.json2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/getPosts.ts b/lib/getPosts.ts
index 814f6d8..058d96d 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 - 3) === ".md");
         files.forEach((file: string) => {
           const fsRoute = `${path}/${year}/${month}/${day}/${file}`;
           try {
diff --git a/package.json b/package.json
index b869077..1dfe621 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "kronikarz",
-  "version": "2.0.1",
+  "version": "2.0.2",
   "description": "System elektronicznej kroniki",
   "main": "dist/index.js",
   "types": "dist/index.d.ts",