SanYeCao-blog/src/layouts/BaseLayout.astro

56 lines
1.3 KiB
Text
Raw Normal View History

2026-03-24 17:33:01 +00:00
---
2026-03-24 22:28:23 +00:00
import Footer from "@/components/Footer.astro";
2026-03-24 18:01:45 +00:00
import Header from "@/components/Header.astro";
2026-03-24 22:50:33 +00:00
import { ClientRouter } from "astro:transitions";
2026-04-17 10:42:26 +00:00
import { fade } from "astro:transitions";
import { getLangFromUrl } from "@/i18n";
const lang = getLangFromUrl(Astro.url);
const htmlLang = lang === "zh" ? "zh-CN" : "en-US";
2026-03-25 15:26:22 +00:00
import SEO from "@/components/SEO.astro";
2026-04-13 20:24:35 +00:00
import FloatingActions from "@/components/FloatingActions.astro";
2026-04-13 20:47:23 +00:00
import Spinner from "@/components/Spinner.astro";
2026-03-24 19:32:44 +00:00
2026-03-26 16:25:07 +00:00
const {
pageTitle,
description = "在这里,发现更多(雾)欢迎来到三叶的博客🥳",
image,
} = Astro.props;
2026-03-24 17:33:01 +00:00
---
2026-03-24 14:19:09 +00:00
<!doctype html>
2026-04-17 10:42:26 +00:00
<html lang={htmlLang}>
2026-03-24 14:19:09 +00:00
<head>
<ClientRouter />
2026-03-24 14:19:09 +00:00
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
2026-03-25 15:26:22 +00:00
<SEO title={pageTitle} description={description} image={image} />
2026-03-24 14:19:09 +00:00
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" href="/favicon.ico" />
<meta name="generator" content={Astro.generator} />
2026-03-24 17:33:01 +00:00
<title>{pageTitle}</title>
2026-03-24 14:19:09 +00:00
</head>
2026-04-13 20:24:35 +00:00
<FloatingActions />
2026-04-13 20:47:23 +00:00
2026-03-24 14:19:09 +00:00
<body>
2026-03-24 18:01:45 +00:00
<Header />
2026-04-13 20:47:23 +00:00
<Spinner />
<main
class="page-content"
transition:animate={fade({ duration: "0.05s" })}
>
2026-03-24 22:50:33 +00:00
<slot />
</main>
2026-03-24 17:33:01 +00:00
<Footer />
2026-03-24 14:19:09 +00:00
</body>
</html>
<style>
html,
body {
margin: 0;
width: 100%;
height: 100%;
}
</style>