Files
research-blog/src/layouts/BaseLayout.astro
T

70 lines
2.5 KiB
Plaintext

---
import "../styles/global.css";
interface Props {
title?: string;
description?: string;
canonical?: string;
article?: boolean;
image?: string;
}
const {
title = "K1412 Research",
description = "技术研究、实验记录与可验证的公开成果。",
canonical = Astro.url.href,
article = false,
image = "/og-default.svg"
} = Astro.props;
const pageTitle = title === "K1412 Research" ? title : `${title} · K1412 Research`;
const socialImage = new URL(image, Astro.site ?? Astro.url).href;
---
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<meta name="description" content={description} />
<meta name="theme-color" content="#f0ede5" />
<meta name="generator" content={Astro.generator} />
<link rel="canonical" href={canonical} />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="alternate" type="application/rss+xml" title="K1412 Research" href="/rss.xml" />
<meta property="og:type" content={article ? "article" : "website"} />
<meta property="og:title" content={pageTitle} />
<meta property="og:description" content={description} />
<meta property="og:url" content={canonical} />
<meta property="og:image" content={socialImage} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={pageTitle} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={socialImage} />
<title>{pageTitle}</title>
</head>
<body>
<div class="site-grain" aria-hidden="true"></div>
<header class="site-header">
<a class="brand" href="/" aria-label="K1412 Research 首页">
<span class="brand-mark" aria-hidden="true">K</span>
<span>K1412 <b>Research</b></span>
</a>
<nav aria-label="主导航">
<a href="/#research">研究</a>
<a href="/archive/">索引</a>
<a href="/method/">方法</a>
<a href="https://git.k1412.top/wuyang/research-blog">源码</a>
</nav>
</header>
<main>
<slot />
</main>
<footer class="site-footer">
<p>K1412 Research</p>
<p>公开研究、可复现实验与独立专题站的统一入口。</p>
<p><a href="https://git.k1412.top/wuyang/research-blog">Source on git.k1412.top</a></p>
</footer>
<div class="release-marker" data-release="K1412-RESEARCH-BLOG-20260810" hidden></div>
</body>
</html>