fix: site url and base dir should be set in astro.config.mjs
This commit is contained in:
parent
d918a2ef3d
commit
b0d265b42b
|
@ -22,6 +22,8 @@ const oklchToHex = function (str) {
|
|||
}
|
||||
|
||||
export default defineConfig({
|
||||
site: 'https://fuwari.vercel.app/',
|
||||
base: '/',
|
||||
integrations: [
|
||||
tailwind(),
|
||||
icon({
|
||||
|
|
|
@ -4,7 +4,6 @@ import {LinkPreset} from "./types/config.ts";
|
|||
export const siteConfig: SiteConfig = {
|
||||
title: 'Fuwari',
|
||||
subtitle: 'Demo Site',
|
||||
url: 'https://fuwari.vercel.app/',
|
||||
lang: 'en',
|
||||
themeHue: 250,
|
||||
banner: {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
export type SiteConfig = {
|
||||
title: string,
|
||||
subtitle: string,
|
||||
url: string,
|
||||
|
||||
lang: string,
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue