From 410902a76712155fe7dc998b0256d81516c5f6b8 Mon Sep 17 00:00:00 2001 From: saicaca Date: Mon, 29 Apr 2024 15:56:28 +0800 Subject: [PATCH] fix: make `base` in astro config work --- astro.config.mjs | 1 + src/components/Navbar.astro | 9 +++++---- src/components/PostMeta.astro | 5 +++-- src/components/Search.svelte | 5 +++-- src/components/control/Pagination.astro | 14 ++++++-------- src/components/misc/ImageWrapper.astro | 4 +++- src/components/widget/Profile.astro | 3 ++- src/components/widget/Tags.astro | 3 ++- src/constants/link-presets.ts | 4 ++-- src/layouts/Layout.astro | 3 ++- src/utils/url-utils.ts | 12 ++++++++---- 11 files changed, 37 insertions(+), 26 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 535d44f..4d87e04 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -26,6 +26,7 @@ const oklchToHex = (str) => { export default defineConfig({ site: "https://fuwari.vercel.app/", base: "/", + trailingSlash: "always", integrations: [ tailwind(), swup({ diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 4da4b93..1367ff8 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -7,6 +7,7 @@ import NavMenuPanel from "./widget/NavMenuPanel.astro"; import Search from "./Search.svelte"; import {LinkPresets} from "../constants/link-presets"; import LightDarkSwitch from "./LightDarkSwitch.svelte"; +import {url} from "../utils/url-utils"; const className = Astro.props.class; let links: NavBarLink[] = navBarConfig.links.map((item: NavBarLink | LinkPreset): NavBarLink => { @@ -20,7 +21,7 @@ let links: NavBarLink[] = navBarConfig.links.map((item: NavBarLink | LinkPreset)
- +
{siteConfig.title} @@ -28,7 +29,7 @@ let links: NavBarLink[] = navBarConfig.links.map((item: NavBarLink | LinkPreset)