chore: 生成站点地图

youngjuning-patch-1
洛竹 2 years ago
parent 1d597b406f
commit cd5e69317e

@ -12,6 +12,7 @@ jobs:
- run: yarn install
- run: yarn build
- run: mv googled29fba422c357ff8.html docs/
- run: node sitemap.js
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:

@ -15,5 +15,9 @@
"serve": "^12.0.0",
"typedoc": "^0.21.5",
"typescript": "^4.3.5"
},
"dependencies": {
"exec-sh": "^0.4.0",
"recursive-readdir": "^2.2.3"
}
}

@ -0,0 +1,15 @@
const fs = require("fs");
const recursive = require("recursive-readdir");
const execSh = require("exec-sh");
(async () =>{
if (!fs.existsSync("./docs")) {
return;
}
const files = await recursive("./docs");
const urls = files.filter(file => file.endsWith('.html')).map(file => {
return file.replace('docs/', 'https://vscode-api-cn.js.org/')
})
fs.writeFileSync("./docs/urls.txt", urls.join("\n"));
execSh("npx sitemap < ./docs/urls.txt > ./docs/sitemap.xml");
})()

@ -267,6 +267,11 @@ escape-string-regexp@^1.0.5:
resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
exec-sh@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.4.0.tgz#0f4ae8c36d166bae80e5c69aba0793d80c3488d5"
integrity sha512-BgAFra+J+hK/wquyWchMiqgaxSv1ec2c+//DRSePlF3NLx/tBOmkIkJEc1hWrX4Yis3tzxgv1+FiFs/mmucs/g==
execa@^0.7.0:
version "0.7.0"
resolved "https://registry.nlark.com/execa/download/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777"
@ -517,6 +522,13 @@ minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"
minimatch@^3.0.5:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"
minimist@^1.2.0, minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
@ -671,6 +683,13 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"
recursive-readdir@^2.2.3:
version "2.2.3"
resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.3.tgz#e726f328c0d69153bcabd5c322d3195252379372"
integrity sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==
dependencies:
minimatch "^3.0.5"
registry-auth-token@3.3.2:
version "3.3.2"
resolved "https://registry.npm.taobao.org/registry-auth-token/download/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20"

Loading…
Cancel
Save