Merge branch 'master' into master

This commit is contained in:
GCHQDeveloper581 2026-02-03 19:25:49 +00:00 committed by GitHub
commit f14896ab0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,5 @@
import sm from "sitemap"; import sm from "sitemap";
import OperationConfig from "../../core/config/OperationConfig.json" assert {type: "json"}; import OperationConfig from "../../core/config/OperationConfig.json" assert { type: "json" };
/** /**
* Generates an XML sitemap for all CyberChef operations and a number of recipes. * Generates an XML sitemap for all CyberChef operations and a number of recipes.
@ -10,25 +9,25 @@ import OperationConfig from "../../core/config/OperationConfig.json" assert {typ
* @license Apache-2.0 * @license Apache-2.0
*/ */
const smStream = new sm.SitemapStream({ const baseUrl = "https://gchq.github.io/CyberChef/";
hostname: "https://gchq.github.io/CyberChef",
}); const smStream = new sm.SitemapStream({});
smStream.write({ smStream.write({
url: "/", url: baseUrl,
changefreq: "weekly", changefreq: "weekly",
priority: 1.0 priority: 1.0,
}); });
for (const op in OperationConfig) { for (const op in OperationConfig) {
smStream.write({ smStream.write({
url: `/?op=${encodeURIComponent(op)}`, url: `${baseUrl}?op=${encodeURIComponent(op)}`,
changeFreq: "yearly", changeFreq: "yearly",
priority: 0.5 priority: 0.5,
}); });
} }
smStream.end(); smStream.end();
sm.streamToPromise(smStream).then( sm.streamToPromise(smStream).then(
buffer => console.log(buffer.toString()) // eslint-disable-line no-console (buffer) => console.log(buffer.toString()), // eslint-disable-line no-console
); );