From 1542cadde8f60d50f2bf8d53d0f0b9f888e2cbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCgo?= <8133415+rbpi@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:44:59 +0700 Subject: [PATCH] Update Sitemap URLs to Use Valid Paths in sitemap.mjs (#1861) Co-authored-by: C85297 <95289555+C85297@users.noreply.github.com> --- src/web/static/sitemap.mjs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/web/static/sitemap.mjs b/src/web/static/sitemap.mjs index b96047fc8..4f8101d4c 100644 --- a/src/web/static/sitemap.mjs +++ b/src/web/static/sitemap.mjs @@ -1,6 +1,5 @@ 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. @@ -10,25 +9,25 @@ import OperationConfig from "../../core/config/OperationConfig.json" assert {typ * @license Apache-2.0 */ -const smStream = new sm.SitemapStream({ - hostname: "https://gchq.github.io/CyberChef", -}); +const baseUrl = "https://gchq.github.io/CyberChef/"; + +const smStream = new sm.SitemapStream({}); smStream.write({ - url: "/", + url: baseUrl, changefreq: "weekly", - priority: 1.0 + priority: 1.0, }); for (const op in OperationConfig) { smStream.write({ - url: `/?op=${encodeURIComponent(op)}`, + url: `${baseUrl}?op=${encodeURIComponent(op)}`, changeFreq: "yearly", - priority: 0.5 + priority: 0.5, }); } smStream.end(); sm.streamToPromise(smStream).then( - buffer => console.log(buffer.toString()) // eslint-disable-line no-console + (buffer) => console.log(buffer.toString()), // eslint-disable-line no-console );