45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
|
|
---
|
|||
|
|
// 页面骨架(spec §9.3 首批公共组件)。
|
|||
|
|
// 数据经 Props 注入(site + page meta)——本组件不直接调 loadRenderData;
|
|||
|
|
// 页面层取数后下传(单一入口纪律的组件侧配合:布局对数据来源保持无感)。
|
|||
|
|
import SeoHead from '../components/SeoHead.astro'
|
|||
|
|
import SiteFooter from '../components/SiteFooter.astro'
|
|||
|
|
import SiteHeader from '../components/SiteHeader.astro'
|
|||
|
|
import type { RenderData } from '../lib/load-render-data'
|
|||
|
|
import type { PageMeta } from '../lib/ui'
|
|||
|
|
import '../styles/tokens.css'
|
|||
|
|
|
|||
|
|
interface Props {
|
|||
|
|
/** 渲染数据(loadRenderData() 的返回值——页面层负责调用) */
|
|||
|
|
data: Pick<RenderData, 'site' | 'routes'>
|
|||
|
|
page: PageMeta
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
const { data, page } = Astro.props
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
<!doctype html>
|
|||
|
|
<html lang={data.site.locale}>
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8" />
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|||
|
|
<SeoHead site={data.site} page={page} />
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<SiteHeader site={data.site} routes={data.routes} />
|
|||
|
|
<main class="site-main">
|
|||
|
|
<div class="site-container">
|
|||
|
|
<slot />
|
|||
|
|
</div>
|
|||
|
|
</main>
|
|||
|
|
<SiteFooter site={data.site} />
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
|
|||
|
|
<style>
|
|||
|
|
.site-main {
|
|||
|
|
min-height: 60vh;
|
|||
|
|
padding-block: var(--space-4);
|
|||
|
|
}
|
|||
|
|
</style>
|