fix: site url and base dir should be set in astro.config.mjs

This commit is contained in:
saicaca
2023-11-08 19:03:35 +08:00
parent d918a2ef3d
commit b0d265b42b
4 changed files with 4 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import {siteConfig} from "../config.ts";
import astroConfig from "../../astro.config.mjs"
export function pathsEqual(path1: string, path2: string) {
const normalizedPath1 = path1.replace(/^\/|\/$/g, '').toLowerCase();
@@ -24,5 +25,5 @@ export function getCategoryUrl(category: string): string | null {
}
export function getFullUrl(path: string): string {
return joinUrl(siteConfig.url, path);
return joinUrl(astroConfig.site || "", astroConfig.base || "", path);
}