fix(sitemap): correct prefix

This commit is contained in:
Bastian Ike
2023-01-19 11:23:45 +01:00
committed by Bastian
parent a48e0bb7db
commit 2c97343bb7
2 changed files with 16 additions and 7 deletions

View File

@@ -1,6 +1,14 @@
#!/usr/bin/env node
import { copyFileSync, mkdirSync, existsSync, readFileSync, writeFileSync } from "fs";
import {
copyFileSync,
existsSync,
mkdirSync,
readFileSync,
writeFileSync,
} from "fs";
import XmlSitemap from "xml-sitemap";
import { publicUrl } from "../src/config";
import { createRadar } from "./generateJson/radar";
// Do this as the first thing so that any code reading it knows the right env.
@@ -39,9 +47,9 @@ const createStaticFiles = async () => {
`build/${item.quadrant}/${item.name}.html`
);
sitemap.add(`${process.env.PUBLIC_URL}/${item.quadrant}/${item.name}.html`, {
lastmod: 'now',
changefreq: 'weekly'
sitemap.add(`${publicUrl}${item.quadrant}/${item.name}.html`, {
lastmod: "now",
changefreq: "weekly",
});
});