From 070b7725be5fb0db486e9370bea5648c16c8bbfe Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sat, 30 Nov 2019 13:12:30 +0100 Subject: Fix posts listing --- scripts/generateApi.js | 5 +++++ scripts/postbuild.sh | 1 + 2 files changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/generateApi.js b/scripts/generateApi.js index f72745e..7635f02 100755 --- a/scripts/generateApi.js +++ b/scripts/generateApi.js @@ -20,4 +20,9 @@ posts.sort((a, b) => (a.route > b.route ? 1 : -1)) fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), err => err ? console.log(err) : null ) + +fs.writeFile('./static/api/posts.json', JSON.stringify(posts), err => + err ? console.log(err) : null +) + console.log(posts) diff --git a/scripts/postbuild.sh b/scripts/postbuild.sh index 85e35f9..6da3659 100755 --- a/scripts/postbuild.sh +++ b/scripts/postbuild.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash mkdir ./dist/api +mkdir ./static/api node -r esm ./scripts/generateApi.js -- cgit 1.4.1 From 7f17fe3486652732565f2be303c536464507c713 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Tue, 3 Dec 2019 12:04:54 +0100 Subject: Fix posts order --- package-lock.json | 14 +++++++------- package.json | 2 +- scripts/generateApi.js | 2 -- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/package-lock.json b/package-lock.json index cb91f6a..dc75e41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3224,7 +3224,7 @@ "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-12.2.4.tgz", "integrity": "sha512-q+De3S/Ri6U9uPx89YA1XuC+QIBgndIfvBaaJG0pRT8Oqa75k4Mr7G9CRZjIvlbLGIukO/31DFGFJYlQBmXf/A==", "requires": { - "@types/node": "12.7.12", + "@types/node": "12.12.14", "@types/tough-cookie": "2.3.5", "parse5": "4.0.0" }, @@ -3237,9 +3237,9 @@ } }, "@types/node": { - "version": "12.7.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.12.tgz", - "integrity": "sha512-KPYGmfD0/b1eXurQ59fXD1GBzhSQfz6/lKBxkaHX9dKTzjXbK68Zt7yGUxUsCS1jeTy/8aL+d9JEr+S54mpkWQ==" + "version": "12.12.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.14.tgz", + "integrity": "sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -11235,9 +11235,9 @@ "dev": true }, "kronikarz": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/kronikarz/-/kronikarz-0.1.3.tgz", - "integrity": "sha512-isj1P/hI1Sd4Lp/rug8Tb3TrFbnSKUdiamAFvFBAuDQhe2xkm2mjMoHiGjSvYCUHdBPYKllCpthEoHfsJhYRHA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/kronikarz/-/kronikarz-1.1.0.tgz", + "integrity": "sha512-pHrekjFEoKg+fP1D6fPwV2ifApjsr+2AbMzGalX0reLGI/pQ3YMdaObXY1WJacYemVKbRE2meWoF67PeNcgY4g==", "requires": { "@types/jsdom": "12.2.4", "front-matter": "3.0.2", diff --git a/package.json b/package.json index 39629c7..d7925a2 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "esm": "^3.2.25", "front-matter": "^3.0.2", "jsdom": "^15.1.1", - "kronikarz": "^0.1.3", + "kronikarz": "^1.1.0", "markdown-it": "^10.0.0", "nuxt": "^2.0.0", "raw-loader": "^3.1.0", diff --git a/scripts/generateApi.js b/scripts/generateApi.js index 7635f02..4b7426a 100755 --- a/scripts/generateApi.js +++ b/scripts/generateApi.js @@ -15,8 +15,6 @@ posts = posts.map(({ date, title, content, route }) => { } }) -posts.sort((a, b) => (a.route > b.route ? 1 : -1)) - fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), err => err ? console.log(err) : null ) -- cgit 1.4.1