summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-12-03 05:38:10 -0500
committerGitHub <noreply@github.com>2019-12-03 05:38:10 -0500
commit7b8d75cd87e392d9ffb3defa538a041c4f7e0f0c (patch)
tree1df469f7a64de304a1230d81510062f4c5f58a67
parent119c621d5298f832ac469ba482624c1d1cbb43c3 (diff)
parent4fa984027fca682f7ec67020833a59a3dd8b7c97 (diff)
downloadkronikarz-7b8d75cd87e392d9ffb3defa538a041c4f7e0f0c.tar.gz
kronikarz-7b8d75cd87e392d9ffb3defa538a041c4f7e0f0c.zip
Merge pull request #3 from pniedzwiedzinski/develop v1.1
Fix parsing error
-rw-r--r--lib/getPosts.ts8
-rw-r--r--package.json2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/getPosts.ts b/lib/getPosts.ts
index 38e419c..c363c67 100644
--- a/lib/getPosts.ts
+++ b/lib/getPosts.ts
@@ -4,13 +4,13 @@ import { readDir } from "./utils";
 
 function getPosts(path: string): Array<Post> {
   let routesArray: Post[] = [];
-  const years = readDir(`${path}`);
+  const years = readDir(`${path}`).reverse();
   years.forEach((year: string) => {
-    const months = readDir(`${path}/${year}`);
+    const months = readDir(`${path}/${year}`).reverse();
     months.forEach((month: string) => {
-      const days = readDir(`${path}/${year}/${month}`);
+      const days = readDir(`${path}/${year}/${month}`).reverse();
       days.forEach((day: string) => {
-        const files = readDir(`${path}/${year}/${month}/${day}`);
+        const files = readDir(`${path}/${year}/${month}/${day}`).reverse();
         files.forEach((file: string) => {
           const fsRoute = `${path}/${year}/${month}/${day}/${file}`;
           try {
diff --git a/package.json b/package.json
index 2a63af7..455c939 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "kronikarz",
-  "version": "1.0.1",
+  "version": "1.1.0",
   "description": "System elektronicznej kroniki",
   "main": "dist/index.js",
   "types": "dist/index.d.ts",