fix(sitemap): correct prefix
This commit is contained in:
@@ -42,6 +42,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var fs_1 = require("fs");
|
var fs_1 = require("fs");
|
||||||
var xml_sitemap_1 = __importDefault(require("xml-sitemap"));
|
var xml_sitemap_1 = __importDefault(require("xml-sitemap"));
|
||||||
|
var config_1 = require("../src/config");
|
||||||
var radar_1 = require("./generateJson/radar");
|
var radar_1 = require("./generateJson/radar");
|
||||||
// Do this as the first thing so that any code reading it knows the right env.
|
// Do this as the first thing so that any code reading it knows the right env.
|
||||||
process.env.BABEL_ENV = "production";
|
process.env.BABEL_ENV = "production";
|
||||||
@@ -75,9 +76,9 @@ var createStaticFiles = function () { return __awaiter(void 0, void 0, void 0, f
|
|||||||
sitemap = new xml_sitemap_1.default();
|
sitemap = new xml_sitemap_1.default();
|
||||||
radar.items.forEach(function (item) {
|
radar.items.forEach(function (item) {
|
||||||
(0, fs_1.copyFileSync)("build/index.html", "build/".concat(item.quadrant, "/").concat(item.name, ".html"));
|
(0, fs_1.copyFileSync)("build/index.html", "build/".concat(item.quadrant, "/").concat(item.name, ".html"));
|
||||||
sitemap.add("".concat(process.env.PUBLIC_URL, "/").concat(item.quadrant, "/").concat(item.name, ".html"), {
|
sitemap.add("".concat(config_1.publicUrl).concat(item.quadrant, "/").concat(item.name, ".html"), {
|
||||||
lastmod: 'now',
|
lastmod: "now",
|
||||||
changefreq: 'weekly'
|
changefreq: "weekly",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
(0, fs_1.writeFileSync)("build/sitemap.xml", sitemap.xml);
|
(0, fs_1.writeFileSync)("build/sitemap.xml", sitemap.xml);
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
#!/usr/bin/env node
|
#!/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 XmlSitemap from "xml-sitemap";
|
||||||
|
|
||||||
|
import { publicUrl } from "../src/config";
|
||||||
import { createRadar } from "./generateJson/radar";
|
import { createRadar } from "./generateJson/radar";
|
||||||
|
|
||||||
// Do this as the first thing so that any code reading it knows the right env.
|
// 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`
|
`build/${item.quadrant}/${item.name}.html`
|
||||||
);
|
);
|
||||||
|
|
||||||
sitemap.add(`${process.env.PUBLIC_URL}/${item.quadrant}/${item.name}.html`, {
|
sitemap.add(`${publicUrl}${item.quadrant}/${item.name}.html`, {
|
||||||
lastmod: 'now',
|
lastmod: "now",
|
||||||
changefreq: 'weekly'
|
changefreq: "weekly",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user