mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 19:46:23 +00:00
rss + sitemap
This commit is contained in:
parent
ba9f243728
commit
4c904d88ab
11 changed files with 131 additions and 491 deletions
428
package-lock.json
generated
428
package-lock.json
generated
|
@ -10,7 +10,6 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@floating-ui/dom": "^1.4.0",
|
"@floating-ui/dom": "^1.4.0",
|
||||||
"@inquirer/prompts": "^1.0.3",
|
|
||||||
"@napi-rs/simple-git": "^0.1.8",
|
"@napi-rs/simple-git": "^0.1.8",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"cli-spinner": "^0.2.10",
|
"cli-spinner": "^0.2.10",
|
||||||
|
@ -411,290 +410,6 @@
|
||||||
"@floating-ui/core": "^1.3.1"
|
"@floating-ui/core": "^1.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@inquirer/checkbox": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-1.3.1.tgz",
|
|
||||||
"integrity": "sha512-3l3aC6gYOPGaVOa9cNe4dZ8t96e3CFifC3Hee1MD+F7qaRxGAuXnhCQiUr4ngj2P7xd9U3DCDbLXNsLKQoHYCg==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/core": "^2.1.0",
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"figures": "^3.2.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/checkbox/node_modules/@inquirer/core": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-Hq9hZ5G/VUaeWkSs283HZwwMbe79lcOI5HWwW1GIM1ohouy2/x489Qf/A1BJYvMUj+QG4LSB5LtVMjn9P3Ge6Q==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"cli-spinners": "^2.8.0",
|
|
||||||
"cli-width": "^4.0.0",
|
|
||||||
"figures": "^3.2.0",
|
|
||||||
"mute-stream": "^1.0.0",
|
|
||||||
"run-async": "^3.0.0",
|
|
||||||
"string-width": "^4.2.3",
|
|
||||||
"strip-ansi": "^6.0.1",
|
|
||||||
"wrap-ansi": "^6.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/confirm": {
|
|
||||||
"version": "1.0.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-1.0.11.tgz",
|
|
||||||
"integrity": "sha512-UWYJ+0dN9rWw0czTPqqKRGLqHsLML9rrQlScn5oOVUtiL2WDTxs95JehP2axKsNkSBMxmFAdA7TdctJkZFJcxA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/core": "^1.3.0",
|
|
||||||
"@inquirer/type": "^1.0.5",
|
|
||||||
"chalk": "^4.1.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/core": {
|
|
||||||
"version": "1.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-1.3.0.tgz",
|
|
||||||
"integrity": "sha512-W7EA48gIMahFLiGW/zF+rgoineqTDK5IQizsOmwvbFfYgiQ8Asetut94THBmB3KnW0nrZL5UPHUK6QzcjEzaCw==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/type": "^1.0.5",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"cli-spinners": "^2.8.0",
|
|
||||||
"cli-width": "^4.0.0",
|
|
||||||
"figures": "^3.2.0",
|
|
||||||
"mute-stream": "^1.0.0",
|
|
||||||
"run-async": "^3.0.0",
|
|
||||||
"string-width": "^4.2.3",
|
|
||||||
"strip-ansi": "^6.0.1",
|
|
||||||
"wrap-ansi": "^6.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/editor": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-1.2.0.tgz",
|
|
||||||
"integrity": "sha512-NMXLLNadvqIR6TD6mNZRa/PKHTvdaa4ndGGeXl+DwybQ4K7cVSJNRrztixpM1KDEoG8Ape5ightNwq25cyugTg==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/core": "^2.1.0",
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"external-editor": "^3.0.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/editor/node_modules/@inquirer/core": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-Hq9hZ5G/VUaeWkSs283HZwwMbe79lcOI5HWwW1GIM1ohouy2/x489Qf/A1BJYvMUj+QG4LSB5LtVMjn9P3Ge6Q==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"cli-spinners": "^2.8.0",
|
|
||||||
"cli-width": "^4.0.0",
|
|
||||||
"figures": "^3.2.0",
|
|
||||||
"mute-stream": "^1.0.0",
|
|
||||||
"run-async": "^3.0.0",
|
|
||||||
"string-width": "^4.2.3",
|
|
||||||
"strip-ansi": "^6.0.1",
|
|
||||||
"wrap-ansi": "^6.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/expand": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-fXk5NG2FOAiluDWPYfXHuof3sklL/HhZh3NnXfnBZ2IhTCRzXvlXRcQcPlev2sGcZknHn0g6JdKlxjSa+7H2nQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/core": "^2.1.0",
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"figures": "^3.2.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/expand/node_modules/@inquirer/core": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-Hq9hZ5G/VUaeWkSs283HZwwMbe79lcOI5HWwW1GIM1ohouy2/x489Qf/A1BJYvMUj+QG4LSB5LtVMjn9P3Ge6Q==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"cli-spinners": "^2.8.0",
|
|
||||||
"cli-width": "^4.0.0",
|
|
||||||
"figures": "^3.2.0",
|
|
||||||
"mute-stream": "^1.0.0",
|
|
||||||
"run-async": "^3.0.0",
|
|
||||||
"string-width": "^4.2.3",
|
|
||||||
"strip-ansi": "^6.0.1",
|
|
||||||
"wrap-ansi": "^6.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/input": {
|
|
||||||
"version": "1.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/input/-/input-1.2.1.tgz",
|
|
||||||
"integrity": "sha512-OYwG3dEo1+lMAE6rYB8b1HTg8eSP++jk0pHSjKZu00gTlN5IHW/dliB82nsWe9Bn//93E9LJ1KrhjFMqOzkCFw==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/core": "^2.1.0",
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"chalk": "^4.1.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/input/node_modules/@inquirer/core": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-Hq9hZ5G/VUaeWkSs283HZwwMbe79lcOI5HWwW1GIM1ohouy2/x489Qf/A1BJYvMUj+QG4LSB5LtVMjn9P3Ge6Q==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"cli-spinners": "^2.8.0",
|
|
||||||
"cli-width": "^4.0.0",
|
|
||||||
"figures": "^3.2.0",
|
|
||||||
"mute-stream": "^1.0.0",
|
|
||||||
"run-async": "^3.0.0",
|
|
||||||
"string-width": "^4.2.3",
|
|
||||||
"strip-ansi": "^6.0.1",
|
|
||||||
"wrap-ansi": "^6.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/password": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/password/-/password-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-3M03aA04hOA4lRjLviB9uGoNmmd1YDNo4CYSFM9Uh4qlXdgvhke3xPU07k3kVstRIo0Te1hF14RL7vEgHJQ8tA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/input": "^1.2.1",
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"chalk": "^4.1.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/prompts": {
|
|
||||||
"version": "1.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-1.2.3.tgz",
|
|
||||||
"integrity": "sha512-vcPUWXA/boMJc5IDVx/9+ihf1FupsBK1RThnEXnLTpF6hR1iJCoaBoSpREZRdDp/XcPHe/b+QovehBYJoWsUhg==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/checkbox": "^1.2.8",
|
|
||||||
"@inquirer/confirm": "^1.0.11",
|
|
||||||
"@inquirer/core": "^1.3.0",
|
|
||||||
"@inquirer/editor": "^1.0.11",
|
|
||||||
"@inquirer/expand": "^1.0.11",
|
|
||||||
"@inquirer/input": "^1.1.2",
|
|
||||||
"@inquirer/password": "^1.0.11",
|
|
||||||
"@inquirer/rawlist": "^1.1.3",
|
|
||||||
"@inquirer/select": "^1.1.7"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/rawlist": {
|
|
||||||
"version": "1.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-1.2.1.tgz",
|
|
||||||
"integrity": "sha512-t8lMbE3Gqook4PvQYQl9eVJrl/mBy5kCgolwY9El8HLyGZ7Wc3SGIqHnQUlha4qms8HPOdUIBzyPfcAXl5+3SQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/core": "^2.1.0",
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"chalk": "^4.1.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/rawlist/node_modules/@inquirer/core": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-Hq9hZ5G/VUaeWkSs283HZwwMbe79lcOI5HWwW1GIM1ohouy2/x489Qf/A1BJYvMUj+QG4LSB5LtVMjn9P3Ge6Q==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"cli-spinners": "^2.8.0",
|
|
||||||
"cli-width": "^4.0.0",
|
|
||||||
"figures": "^3.2.0",
|
|
||||||
"mute-stream": "^1.0.0",
|
|
||||||
"run-async": "^3.0.0",
|
|
||||||
"string-width": "^4.2.3",
|
|
||||||
"strip-ansi": "^6.0.1",
|
|
||||||
"wrap-ansi": "^6.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/select": {
|
|
||||||
"version": "1.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/select/-/select-1.2.1.tgz",
|
|
||||||
"integrity": "sha512-13JDLtlwFoqQUYRdMzz5wP3a4DWccJfNA/8M8MDUhhZ8HeKZ3MPaTMlpxwY+Q0Jgbmt56nf7xUuck0XXPce8Xw==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/core": "^2.1.0",
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"figures": "^3.2.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/select/node_modules/@inquirer/core": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-Hq9hZ5G/VUaeWkSs283HZwwMbe79lcOI5HWwW1GIM1ohouy2/x489Qf/A1BJYvMUj+QG4LSB5LtVMjn9P3Ge6Q==",
|
|
||||||
"dependencies": {
|
|
||||||
"@inquirer/type": "^1.1.0",
|
|
||||||
"ansi-escapes": "^4.3.2",
|
|
||||||
"chalk": "^4.1.2",
|
|
||||||
"cli-spinners": "^2.8.0",
|
|
||||||
"cli-width": "^4.0.0",
|
|
||||||
"figures": "^3.2.0",
|
|
||||||
"mute-stream": "^1.0.0",
|
|
||||||
"run-async": "^3.0.0",
|
|
||||||
"string-width": "^4.2.3",
|
|
||||||
"strip-ansi": "^6.0.1",
|
|
||||||
"wrap-ansi": "^6.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@inquirer/type": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-XMaorygt2o/mXinZg/OOz6d3JKuV3o4jRc/3KDiVPeKLLkjiO4iJErbLKtKn+Od2ZC2lbiFQkrIuloVpEubisA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.18.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@isaacs/cliui": {
|
"node_modules/@isaacs/cliui": {
|
||||||
"version": "8.0.2",
|
"version": "8.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||||
|
@ -1386,20 +1101,6 @@
|
||||||
"integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==",
|
"integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/ansi-escapes": {
|
|
||||||
"version": "4.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
|
|
||||||
"integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"type-fest": "^0.21.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ansi-regex": {
|
"node_modules/ansi-regex": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
@ -1539,11 +1240,6 @@
|
||||||
"url": "https://github.com/sponsors/wooorm"
|
"url": "https://github.com/sponsors/wooorm"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chardet": {
|
|
||||||
"version": "0.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
|
|
||||||
"integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA=="
|
|
||||||
},
|
|
||||||
"node_modules/chokidar": {
|
"node_modules/chokidar": {
|
||||||
"version": "3.5.3",
|
"version": "3.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||||
|
@ -1578,25 +1274,6 @@
|
||||||
"node": ">=0.10"
|
"node": ">=0.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cli-spinners": {
|
|
||||||
"version": "2.9.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.0.tgz",
|
|
||||||
"integrity": "sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/cli-width": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/cliui": {
|
"node_modules/cliui": {
|
||||||
"version": "8.0.1",
|
"version": "8.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
||||||
|
@ -2195,14 +1872,6 @@
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/escape-string-regexp": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
|
||||||
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/esprima": {
|
"node_modules/esprima": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
||||||
|
@ -2231,30 +1900,6 @@
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/external-editor": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
|
|
||||||
"dependencies": {
|
|
||||||
"chardet": "^0.7.0",
|
|
||||||
"iconv-lite": "^0.4.24",
|
|
||||||
"tmp": "^0.0.33"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/external-editor/node_modules/iconv-lite": {
|
|
||||||
"version": "0.4.24",
|
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
|
||||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
|
||||||
"dependencies": {
|
|
||||||
"safer-buffer": ">= 2.1.2 < 3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fast-glob": {
|
"node_modules/fast-glob": {
|
||||||
"version": "3.2.12",
|
"version": "3.2.12",
|
||||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz",
|
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz",
|
||||||
|
@ -2298,20 +1943,6 @@
|
||||||
"url": "https://github.com/sponsors/wooorm"
|
"url": "https://github.com/sponsors/wooorm"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/figures": {
|
|
||||||
"version": "3.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
|
|
||||||
"integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==",
|
|
||||||
"dependencies": {
|
|
||||||
"escape-string-regexp": "^1.0.5"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fill-range": {
|
"node_modules/fill-range": {
|
||||||
"version": "7.0.1",
|
"version": "7.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||||
|
@ -3881,14 +3512,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||||
},
|
},
|
||||||
"node_modules/mute-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==",
|
|
||||||
"engines": {
|
|
||||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/nlcst-to-string": {
|
"node_modules/nlcst-to-string": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz",
|
||||||
|
@ -3909,14 +3532,6 @@
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/os-tmpdir": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/parse-latin": {
|
"node_modules/parse-latin": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-5.0.1.tgz",
|
||||||
|
@ -4407,14 +4022,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz",
|
||||||
"integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg=="
|
"integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg=="
|
||||||
},
|
},
|
||||||
"node_modules/run-async": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.12.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/run-parallel": {
|
"node_modules/run-parallel": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
||||||
|
@ -4698,17 +4305,6 @@
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tmp": {
|
|
||||||
"version": "0.0.33",
|
|
||||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
|
||||||
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
|
|
||||||
"dependencies": {
|
|
||||||
"os-tmpdir": "~1.0.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.6.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/to-regex-range": {
|
"node_modules/to-regex-range": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
|
@ -4751,17 +4347,6 @@
|
||||||
"url": "https://github.com/sponsors/wooorm"
|
"url": "https://github.com/sponsors/wooorm"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/type-fest": {
|
|
||||||
"version": "0.21.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
|
|
||||||
"integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.1.3",
|
"version": "5.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz",
|
||||||
|
@ -5023,19 +4608,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.4.0.tgz",
|
||||||
"integrity": "sha512-i3KR1mQMNwY2wx20ozq2EjISGtQWDIfV56We+yGJ5yDs8jTwQiLLaqHlkBHITlCuJnYlVRmXegxFxZg7gqI++A=="
|
"integrity": "sha512-i3KR1mQMNwY2wx20ozq2EjISGtQWDIfV56We+yGJ5yDs8jTwQiLLaqHlkBHITlCuJnYlVRmXegxFxZg7gqI++A=="
|
||||||
},
|
},
|
||||||
"node_modules/wrap-ansi": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-styles": "^4.0.0",
|
|
||||||
"string-width": "^4.1.0",
|
|
||||||
"strip-ansi": "^6.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/wrap-ansi-cjs": {
|
"node_modules/wrap-ansi-cjs": {
|
||||||
"name": "wrap-ansi",
|
"name": "wrap-ansi",
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@floating-ui/dom": "^1.4.0",
|
"@floating-ui/dom": "^1.4.0",
|
||||||
"@inquirer/prompts": "^1.0.3",
|
|
||||||
"@napi-rs/simple-git": "^0.1.8",
|
"@napi-rs/simple-git": "^0.1.8",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"cli-spinner": "^0.2.10",
|
"cli-spinner": "^0.2.10",
|
||||||
|
|
|
@ -5,7 +5,7 @@ import * as Plugin from "./quartz/plugins"
|
||||||
const sharedPageComponents = {
|
const sharedPageComponents = {
|
||||||
head: Component.Head(),
|
head: Component.Head(),
|
||||||
header: [
|
header: [
|
||||||
Component.PageTitle({ title: "🪴 Quartz 4.0" }),
|
Component.PageTitle(),
|
||||||
Component.Spacer(),
|
Component.Spacer(),
|
||||||
Component.Search(),
|
Component.Search(),
|
||||||
Component.Darkmode()
|
Component.Darkmode()
|
||||||
|
@ -43,7 +43,10 @@ const listPageLayout: PageLayout = {
|
||||||
|
|
||||||
const config: QuartzConfig = {
|
const config: QuartzConfig = {
|
||||||
configuration: {
|
configuration: {
|
||||||
|
pageTitle: "🪴 Quartz 4.0",
|
||||||
enableSPA: true,
|
enableSPA: true,
|
||||||
|
enablePopovers: true,
|
||||||
|
canonicalUrl: "quartz.jzhao.xyz",
|
||||||
ignorePatterns: ["private", "templates"],
|
ignorePatterns: ["private", "templates"],
|
||||||
theme: {
|
theme: {
|
||||||
typography: { // loaded from Google Fonts
|
typography: { // loaded from Google Fonts
|
||||||
|
@ -90,7 +93,7 @@ const config: QuartzConfig = {
|
||||||
Plugin.Description(),
|
Plugin.Description(),
|
||||||
],
|
],
|
||||||
filters: [
|
filters: [
|
||||||
Plugin.RemoveDrafts()
|
Plugin.RemoveDrafts(),
|
||||||
],
|
],
|
||||||
emitters: [
|
emitters: [
|
||||||
Plugin.AliasRedirects(),
|
Plugin.AliasRedirects(),
|
||||||
|
@ -109,8 +112,10 @@ const config: QuartzConfig = {
|
||||||
...listPageLayout,
|
...listPageLayout,
|
||||||
pageBody: Component.FolderContent(),
|
pageBody: Component.FolderContent(),
|
||||||
}),
|
}),
|
||||||
Plugin.ContentIndex(), // you can exclude this if you don't plan on using popovers, graph view, or backlinks
|
Plugin.ContentIndex({
|
||||||
Plugin.CNAME({ domain: "quartz.jzhao.xyz" }) // set this to your final deployed domain
|
enableSiteMap: true,
|
||||||
|
enableRSS: true,
|
||||||
|
}),
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,17 @@ import { PluginTypes } from "./plugins/types"
|
||||||
import { Theme } from "./theme"
|
import { Theme } from "./theme"
|
||||||
|
|
||||||
export interface GlobalConfiguration {
|
export interface GlobalConfiguration {
|
||||||
|
pageTitle: string,
|
||||||
/** Whether to enable single-page-app style rendering. this prevents flashes of unstyled content and improves smoothness of Quartz */
|
/** Whether to enable single-page-app style rendering. this prevents flashes of unstyled content and improves smoothness of Quartz */
|
||||||
enableSPA: boolean,
|
enableSPA: boolean,
|
||||||
/** Whether to display Wikipedia-style popovers when hovering over links */
|
/** Whether to display Wikipedia-style popovers when hovering over links */
|
||||||
enablePopovers: boolean,
|
enablePopovers: boolean,
|
||||||
/** Glob patterns to not search */
|
/** Glob patterns to not search */
|
||||||
ignorePatterns: string[],
|
ignorePatterns: string[],
|
||||||
|
/** Base URL to use for CNAME files, sitemaps, and RSS feeds that require an absolute URL.
|
||||||
|
* Quartz will avoid using this as much as possible and use relative URLs most of the time
|
||||||
|
*/
|
||||||
|
canonicalUrl?: string,
|
||||||
theme: Theme
|
theme: Theme
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,17 @@
|
||||||
import { resolveToRoot } from "../path"
|
import { resolveToRoot } from "../path"
|
||||||
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||||
|
|
||||||
interface Options {
|
function PageTitle({ fileData, cfg }: QuartzComponentProps) {
|
||||||
title: string
|
const title = cfg?.pageTitle ?? "Untitled Quartz"
|
||||||
}
|
|
||||||
|
|
||||||
export default ((opts?: Options) => {
|
|
||||||
const title = opts?.title ?? "Untitled Quartz"
|
|
||||||
function PageTitle({ fileData }: QuartzComponentProps) {
|
|
||||||
const slug = fileData.slug!
|
const slug = fileData.slug!
|
||||||
const baseDir = resolveToRoot(slug)
|
const baseDir = resolveToRoot(slug)
|
||||||
return <h1 class="page-title"><a href={baseDir}>{title}</a></h1>
|
return <h1 class="page-title"><a href={baseDir}>{title}</a></h1>
|
||||||
}
|
}
|
||||||
|
|
||||||
PageTitle.css = `
|
PageTitle.css = `
|
||||||
.page-title {
|
.page-title {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
return PageTitle
|
export default (() => PageTitle) satisfies QuartzComponentConstructor
|
||||||
}) satisfies QuartzComponentConstructor
|
|
||||||
|
|
|
@ -27,6 +27,9 @@ export function slugify(s: string): string {
|
||||||
// resolve /a/b/c to ../../
|
// resolve /a/b/c to ../../
|
||||||
export function resolveToRoot(slug: string): string {
|
export function resolveToRoot(slug: string): string {
|
||||||
let fp = trimPathSuffix(slug)
|
let fp = trimPathSuffix(slug)
|
||||||
|
if (fp.endsWith("index")) {
|
||||||
|
fp = fp.slice(0, -"index".length)
|
||||||
|
}
|
||||||
|
|
||||||
if (fp === "") {
|
if (fp === "") {
|
||||||
return "."
|
return "."
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
import { QuartzEmitterPlugin } from "../types"
|
|
||||||
|
|
||||||
interface Options {
|
|
||||||
domain: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export const CNAME: QuartzEmitterPlugin<Options> = (opts?: Options) => ({
|
|
||||||
name: "CNAME",
|
|
||||||
getQuartzComponents() {
|
|
||||||
return []
|
|
||||||
},
|
|
||||||
async emit(_contentFolder, _cfg, _content, _resources, emit): Promise<string[]> {
|
|
||||||
const slug = "CNAME"
|
|
||||||
|
|
||||||
if (opts?.domain) {
|
|
||||||
await emit({
|
|
||||||
content: opts?.domain,
|
|
||||||
slug,
|
|
||||||
ext: "",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return ["CNAME"]
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,37 +1,120 @@
|
||||||
|
import { GlobalConfiguration } from "../../cfg"
|
||||||
import { QuartzEmitterPlugin } from "../types"
|
import { QuartzEmitterPlugin } from "../types"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
|
|
||||||
export type ContentIndex = Map<string, ContentDetails>
|
export type ContentIndex = Map<string, ContentDetails>
|
||||||
export type ContentDetails = {
|
export type ContentDetails = {
|
||||||
title: string,
|
title: string,
|
||||||
links?: string[],
|
links: string[],
|
||||||
tags?: string[],
|
tags: string[],
|
||||||
content: string,
|
content: string,
|
||||||
|
date?: Date,
|
||||||
|
description?: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ContentIndex: QuartzEmitterPlugin = () => {
|
interface Options {
|
||||||
|
enableSiteMap: boolean
|
||||||
|
enableRSS: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const defaultOptions: Options = {
|
||||||
|
enableSiteMap: true,
|
||||||
|
enableRSS: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateSiteMap(cfg: GlobalConfiguration, idx: ContentIndex): string {
|
||||||
|
const base = cfg.canonicalUrl ?? ""
|
||||||
|
const createURLEntry = (slug: string, content: ContentDetails): string => `<url>
|
||||||
|
<loc>https://${base}/${slug}</loc>
|
||||||
|
<lastmod>${content.date?.toISOString()}</lastmod>
|
||||||
|
</url>`
|
||||||
|
const urls = Array.from(idx).map(([slug, content]) => createURLEntry(slug, content)).join("")
|
||||||
|
return `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">${urls}</urlset>`
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateRSSFeed(cfg: GlobalConfiguration, idx: ContentIndex): string {
|
||||||
|
const base = cfg.canonicalUrl ?? ""
|
||||||
|
const root = `https://${base}`
|
||||||
|
|
||||||
|
// TODO: ogimage
|
||||||
|
const createURLEntry = (slug: string, content: ContentDetails): string => `<items>
|
||||||
|
<title>${content.title}</title>
|
||||||
|
<link>${root}/${slug}</link>
|
||||||
|
<guid>${root}/${slug}</guid>
|
||||||
|
<description>${content.description}</description>
|
||||||
|
<pubDate>${content.date?.toUTCString()}</pubDate>
|
||||||
|
</items>`
|
||||||
|
|
||||||
|
const items = Array.from(idx).map(([slug, content]) => createURLEntry(slug, content)).join("")
|
||||||
|
return `<rss xmlns:atom="http://www.w3.org/2005/atom" version="2.0">
|
||||||
|
<channel>
|
||||||
|
<title>${cfg.pageTitle}</title>
|
||||||
|
<link>${root}</link>
|
||||||
|
<description>Recent content on ${cfg.pageTitle}</description>
|
||||||
|
<generator>Quartz -- quartz.jzhao.xyz</generator>
|
||||||
|
<atom:link href="${root}/index.xml" rel="self" type="application/rss+xml"/>
|
||||||
|
</channel>
|
||||||
|
${items}
|
||||||
|
</rss>`
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ContentIndex: QuartzEmitterPlugin<Options> = (opts) => {
|
||||||
|
opts = { ...defaultOptions, ...opts }
|
||||||
return {
|
return {
|
||||||
name: "ContentIndex",
|
name: "ContentIndex",
|
||||||
async emit(_contentDir, _cfg, content, _resources, emit) {
|
async emit(_contentDir, cfg, content, _resources, emit) {
|
||||||
const fp = path.join("static", "contentIndex")
|
const emitted: string[] = []
|
||||||
const linkIndex: ContentIndex = new Map()
|
const linkIndex: ContentIndex = new Map()
|
||||||
for (const [_tree, file] of content) {
|
for (const [_tree, file] of content) {
|
||||||
let slug = file.data.slug!
|
const slug = file.data.slug!
|
||||||
|
const date = file.data.dates?.modified ?? new Date()
|
||||||
linkIndex.set(slug, {
|
linkIndex.set(slug, {
|
||||||
title: file.data.frontmatter?.title!,
|
title: file.data.frontmatter?.title!,
|
||||||
links: file.data.links ?? [],
|
links: file.data.links ?? [],
|
||||||
tags: file.data.frontmatter?.tags,
|
tags: file.data.frontmatter?.tags ?? [],
|
||||||
content: file.data.text ?? ""
|
content: file.data.text ?? "",
|
||||||
|
date: date,
|
||||||
|
description: file.data.description ?? ""
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opts?.enableSiteMap) {
|
||||||
await emit({
|
await emit({
|
||||||
content: JSON.stringify(Object.fromEntries(linkIndex)),
|
content: generateSiteMap(cfg, linkIndex),
|
||||||
|
slug: "sitemap",
|
||||||
|
ext: ".xml"
|
||||||
|
})
|
||||||
|
emitted.push("sitemap.xml")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opts?.enableRSS) {
|
||||||
|
await emit({
|
||||||
|
content: generateRSSFeed(cfg, linkIndex),
|
||||||
|
slug: "index",
|
||||||
|
ext: ".xml"
|
||||||
|
})
|
||||||
|
emitted.push("index.xml")
|
||||||
|
}
|
||||||
|
|
||||||
|
const fp = path.join("static", "contentIndex")
|
||||||
|
const simplifiedIndex = Object.fromEntries(
|
||||||
|
Array.from(linkIndex).map(([slug, content]) => {
|
||||||
|
// remove description and from content index as nothing downstream
|
||||||
|
// actually uses it. we only keep it in the index as we need it
|
||||||
|
// for the RSS feed
|
||||||
|
delete content.description
|
||||||
|
delete content.date
|
||||||
|
return [slug, content]
|
||||||
|
})
|
||||||
|
)
|
||||||
|
await emit({
|
||||||
|
content: JSON.stringify(simplifiedIndex),
|
||||||
slug: fp,
|
slug: fp,
|
||||||
ext: ".json",
|
ext: ".json",
|
||||||
})
|
})
|
||||||
|
emitted.push(`${fp}.json`)
|
||||||
|
|
||||||
return [`${fp}.json`]
|
return emitted
|
||||||
},
|
},
|
||||||
getQuartzComponents: () => [],
|
getQuartzComponents: () => [],
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,4 +3,3 @@ export { TagPage } from './tagPage'
|
||||||
export { FolderPage } from './folderPage'
|
export { FolderPage } from './folderPage'
|
||||||
export { ContentIndex } from './contentIndex'
|
export { ContentIndex } from './contentIndex'
|
||||||
export { AliasRedirects } from './aliases'
|
export { AliasRedirects } from './aliases'
|
||||||
export { CNAME } from './cname'
|
|
||||||
|
|
|
@ -51,6 +51,11 @@ export function emitComponentResources(cfg: GlobalConfiguration, resources: Stat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg.enablePopovers) {
|
||||||
|
componentResources.afterDOMLoaded.push(popoverScript)
|
||||||
|
componentResources.css.push(popoverStyle)
|
||||||
|
}
|
||||||
|
|
||||||
if (cfg.enableSPA) {
|
if (cfg.enableSPA) {
|
||||||
componentResources.afterDOMLoaded.push(spaRouterScript)
|
componentResources.afterDOMLoaded.push(spaRouterScript)
|
||||||
} else {
|
} else {
|
||||||
|
@ -61,11 +66,6 @@ export function emitComponentResources(cfg: GlobalConfiguration, resources: Stat
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.enablePopovers) {
|
|
||||||
componentResources.afterDOMLoaded.push(popoverScript)
|
|
||||||
componentResources.css.push(popoverStyle)
|
|
||||||
}
|
|
||||||
|
|
||||||
emit({
|
emit({
|
||||||
slug: "index",
|
slug: "index",
|
||||||
ext: ".css",
|
ext: ".css",
|
||||||
|
|
|
@ -10,6 +10,10 @@ const defaultOptions: Options = {
|
||||||
descriptionLength: 150
|
descriptionLength: 150
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const escapeHTML = (unsafe: string) => {
|
||||||
|
return unsafe.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", ''');
|
||||||
|
}
|
||||||
|
|
||||||
export const Description: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => {
|
export const Description: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => {
|
||||||
const opts = { ...defaultOptions, ...userOpts }
|
const opts = { ...defaultOptions, ...userOpts }
|
||||||
return {
|
return {
|
||||||
|
@ -19,7 +23,7 @@ export const Description: QuartzTransformerPlugin<Partial<Options> | undefined>
|
||||||
() => {
|
() => {
|
||||||
return async (tree: HTMLRoot, file) => {
|
return async (tree: HTMLRoot, file) => {
|
||||||
const frontMatterDescription = file.data.frontmatter?.description
|
const frontMatterDescription = file.data.frontmatter?.description
|
||||||
const text = toString(tree)
|
const text = escapeHTML(toString(tree))
|
||||||
|
|
||||||
const desc = frontMatterDescription ?? text
|
const desc = frontMatterDescription ?? text
|
||||||
const sentences = desc.replace(/\s+/g, ' ').split('.')
|
const sentences = desc.replace(/\s+/g, ' ').split('.')
|
||||||
|
|
Loading…
Reference in a new issue