mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
Fixed sitemap
This commit is contained in:
parent
cbff4161a1
commit
2018b7e247
1 changed files with 8 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
import Sitemap from "sitemap";
|
import sm from "sitemap";
|
||||||
import OperationConfig from "../../core/config/OperationConfig.json";
|
import OperationConfig from "../../core/config/OperationConfig.json";
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,24 +10,25 @@ import OperationConfig from "../../core/config/OperationConfig.json";
|
||||||
* @license Apache-2.0
|
* @license Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const sitemap = Sitemap.createSitemap({
|
const smStream = new sm.SitemapStream({
|
||||||
hostname: "https://gchq.github.io/CyberChef",
|
hostname: "https://gchq.github.io/CyberChef",
|
||||||
});
|
});
|
||||||
|
|
||||||
sitemap.add({
|
smStream.write({
|
||||||
url: "/",
|
url: "/",
|
||||||
changefreq: "weekly",
|
changefreq: "weekly",
|
||||||
priority: 1.0
|
priority: 1.0
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const op in OperationConfig) {
|
for (const op in OperationConfig) {
|
||||||
sitemap.add({
|
smStream.write({
|
||||||
url: `/?op=${encodeURIComponent(op)}`,
|
url: `/?op=${encodeURIComponent(op)}`,
|
||||||
changeFreq: "yearly",
|
changeFreq: "yearly",
|
||||||
priority: 0.5
|
priority: 0.5
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
smStream.end();
|
||||||
|
|
||||||
const xml = sitemap.toString();
|
sm.streamToPromise(smStream).then(
|
||||||
|
buffer => console.log(buffer.toString()) // eslint-disable-line no-console
|
||||||
console.log(xml); // eslint-disable-line no-console
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue