feat: add basic working spa mode

This commit is contained in:
草师傅 2025-07-21 22:22:37 +08:00
parent 4ab42f9543
commit 8033b18a64
Signed by: gb
GPG key ID: 43330A030E2D6478
5 changed files with 93 additions and 53 deletions

View file

@ -19,6 +19,9 @@ interface Props {
ogImage?: string;
}
import { ClientRouter } from "astro:transitions";
const spaEnabled = siteConfig.spa
const noscript = siteConfig.noClientJavaScript
const statisticsEnabled = siteConfig.siteAnalytics.enabled
@ -44,6 +47,8 @@ const { title = pageTitle, author = siteConfig.defaultAuthor.name,description =
<meta name="generator" content={Astro.generator} />
<Meta title={pageTitle} author={author} description={description} ogImage={ogImage} />
<title>{pageTitle}</title>
{spaEnabled && <ClientRouter fallback="animate" />}
<!--transitional animation is broken in firefox though-->
</head>
<body>
<main>