Skip to content

Commit

Permalink
✨ Append base URL to CNAME to fix asset loading
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Apr 2, 2024
2 parents 9b4cd08 + b7bd96a commit 9e6ecbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pre-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ export const preProcess = async () => {
i18n?: { [index: string]: string };
"status-website"?: {
cname?: string;
baseUrl?: string;
};
} = load(await readFile(join("..", ".upptimerc.yml"), "utf8")) as any;
if (!config.owner || !config.repo) throw new Error("Owner/repo not set");
config.path = `https://${config.owner}.github.io/${config.repo}`;
if (config["status-website"]?.cname) config.path = `https://${config["status-website"].cname}`;
if (config["status-website"]?.cname) config.path = `https://${config["status-website"].cname}${config["status-website"]?.baseUrl ?? ""}`;
config.i18n = { ...i18n, ...config.i18n };
await ensureDir(join(".", "src", "data"));
await writeJson(join(".", "src", "data", "config.json"), config);
Expand Down

0 comments on commit 9e6ecbd

Please sign in to comment.