From 4db61938f0ae98ad62ff99332a9cad517ee5d849 Mon Sep 17 00:00:00 2001 From: peter_rabbit <pierrejarriges@gmail.com> Date: Thu, 21 Jan 2021 17:37:09 +0100 Subject: [PATCH] fix broken json --- public/game-articles/index.json | 4 +++- public/games/games.js | 2 +- public/main.js | 2 +- public/news-articles/index.json | 4 +++- public/software-articles/index.json | 4 +++- src/lib/article-utils.js | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/public/game-articles/index.json b/public/game-articles/index.json index b6bc394..e1e7267 100644 --- a/public/game-articles/index.json +++ b/public/game-articles/index.json @@ -1 +1,3 @@ -["fantom_quest/fantom_quest.json"] +{ + "articles": ["fantom_quest/fantom_quest.json"] +} diff --git a/public/games/games.js b/public/games/games.js index 4b8194e..1fe170a 100644 --- a/public/games/games.js +++ b/public/games/games.js @@ -117,7 +117,7 @@ function loadArticles(dir_url) { fetchjson(`${dir_url}/index.json`) .then(json => { Promise.all( - json.map(async articlePath => { + json.articles.map(async articlePath => { const art = await fetchjson(`${dir_url}/${articlePath}`); const tmpSplit = articlePath.split("/"); tmpSplit.pop(); diff --git a/public/main.js b/public/main.js index 738bfa2..9acdbd6 100644 --- a/public/main.js +++ b/public/main.js @@ -386,7 +386,7 @@ function loadArticles(dir_url) { fetchjson(`${dir_url}/index.json`) .then(json => { Promise.all( - json.map(async articlePath => { + json.articles.map(async articlePath => { const art = await fetchjson(`${dir_url}/${articlePath}`); const tmpSplit = articlePath.split("/"); tmpSplit.pop(); diff --git a/public/news-articles/index.json b/public/news-articles/index.json index 47ee609..97e3021 100644 --- a/public/news-articles/index.json +++ b/public/news-articles/index.json @@ -1 +1,3 @@ -["test/article-test.json", "nested/article-nested.json"] +{ + "articles": ["test/article-test.json", "nested/article-nested.json"] +} diff --git a/public/software-articles/index.json b/public/software-articles/index.json index 0637a08..be123e8 100644 --- a/public/software-articles/index.json +++ b/public/software-articles/index.json @@ -1 +1,3 @@ -[] \ No newline at end of file +{ + "articles": [] +} diff --git a/src/lib/article-utils.js b/src/lib/article-utils.js index 0d68c2a..687a8b3 100644 --- a/src/lib/article-utils.js +++ b/src/lib/article-utils.js @@ -26,7 +26,7 @@ function loadArticles(dir_url) { fetchjson(`${dir_url}/index.json`) .then(json => { Promise.all( - json.map(async articlePath => { + json.articles.map(async articlePath => { const art = await fetchjson(`${dir_url}/${articlePath}`); const tmpSplit = articlePath.split("/"); tmpSplit.pop(); -- GitLab