diff --git a/astro.config.mjs b/astro.config.mjs index 603df88..3d3c4dc 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -176,7 +176,7 @@ export default defineConfig({ mdx({ rehypePlugins: [ rehypeHeadingIds, - rehypeRelativeAssets, + [rehypeRelativeAssets, { base: isGithubPages ? '/website' : '' }], ] }), react(), diff --git a/src/components/card.v2.tsx b/src/components/card.v2.tsx index 6dc57c1..2e94a1a 100644 --- a/src/components/card.v2.tsx +++ b/src/components/card.v2.tsx @@ -1,6 +1,8 @@ import type { ReactNode } from "react"; import {truncateStringToLength} from "../lib/utils.ts"; +const BASE = import.meta.env.BASE_URL; + export type CardTypeProps = { title: string; summary: string; @@ -14,7 +16,7 @@ export default function CardV2(props: CardTypeProps) {
  • - {props.title diff --git a/src/components/featured-news.astro b/src/components/featured-news.astro index 2bfe90c..892da8d 100644 --- a/src/components/featured-news.astro +++ b/src/components/featured-news.astro @@ -4,13 +4,14 @@ import { HiArrowSmRight } from "react-icons/hi"; const news = (await getCollection("news")) .sort((a, b) => new Date(b.data.date).getTime() - new Date(a.data.date).getTime()) .splice(0, 3); +const BASE = import.meta.env.BASE_URL; ---