chore: fix warning and remove unless config code

This commit is contained in:
Guoqi Sun 2024-12-22 02:14:54 +08:00
parent aaaf100d2c
commit fda8a2fcd1
2 changed files with 5 additions and 5 deletions

View file

@ -5,6 +5,7 @@ import { defineConfig } from "astro/config"
// https://astro.build/config
export default defineConfig({
output: "static",
site: "https://astro-air.netlify.app",
vite: {
worker: {
@ -12,5 +13,4 @@ export default defineConfig({
},
},
integrations: [react(), tailwind(), mdx()],
viewTransitions: true,
})

View file

@ -49,7 +49,8 @@ const config = lang === "zh" ? zh.meta : en.meta
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={ogImageURL} />
<ClientRouter />
<ClientRouter fallback="swap" />
<script is:inline>
const setTheme = () => {
const theme =
@ -67,9 +68,8 @@ const config = lang === "zh" ? zh.meta : en.meta
setTheme()
document.addEventListener("astro:page-load", () => {
setTheme()
})
document.addEventListener("astro:after-swap", setTheme)
document.addEventListener("astro:page-load", setTheme)
</script>
<script