diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-12-03 11:32:19 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-12-03 11:32:19 +0100 |
commit | f144307a41a542fd9e75aa51522ee5c5f57925a4 (patch) | |
tree | 799e9a81a68b39c882fdfde40980e15481fe8f4f /lib | |
parent | e4569fab098cce9be5234fac6148f514959cae0e (diff) | |
download | kronikarz-f144307a41a542fd9e75aa51522ee5c5f57925a4.tar.gz kronikarz-f144307a41a542fd9e75aa51522ee5c5f57925a4.zip |
Fix parsing order
Diffstat (limited to 'lib')
-rw-r--r-- | lib/getPosts.ts | 8 |
1 files changed, 4 insertions, 4 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 { |