From 239c546d5f2fa297a5eac09ea6e1fa24334bcd6c Mon Sep 17 00:00:00 2001 From: saicaca Date: Thu, 9 Nov 2023 12:01:32 +0800 Subject: [PATCH] fix: fix build fail --- src/components/misc/License.astro | 3 +-- src/utils/url-utils.ts | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/misc/License.astro b/src/components/misc/License.astro index f5b93ef..16e9624 100644 --- a/src/components/misc/License.astro +++ b/src/components/misc/License.astro @@ -12,14 +12,13 @@ const className = Astro.props.class; import { Icon } from 'astro-icon/components'; import {licenseConfig, profileConfig} from "../../config"; -import {getFullUrl, getPostUrlBySlug} from "../../utils/url-utils"; import {i18n} from "../../i18n/translation"; import I18nKey from "../../i18n/i18nKey"; const profileConf = profileConfig; const licenseConf = licenseConfig; -const postUrl = getFullUrl(getPostUrlBySlug(slug)); +const postUrl = Astro.url; ---
diff --git a/src/utils/url-utils.ts b/src/utils/url-utils.ts index c09e8bf..1b2205d 100644 --- a/src/utils/url-utils.ts +++ b/src/utils/url-utils.ts @@ -1,5 +1,3 @@ -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,6 +22,3 @@ export function getCategoryUrl(category: string): string | null { return `/archive/category/${category}`; } -export function getFullUrl(path: string): string { - return joinUrl(astroConfig.site || "", astroConfig.base || "", path); -} \ No newline at end of file