diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..9b53d13 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,39 @@ +--- +// 页脚:版权 + ICP 备案(法定保留)+ 构建透明槽位(T7 built-from 填充) +--- + + + + diff --git a/src/components/Header.astro b/src/components/Header.astro new file mode 100644 index 0000000..d1c17a9 --- /dev/null +++ b/src/components/Header.astro @@ -0,0 +1,84 @@ +--- +// 顶部导航:≤4 项纪律(防 higan 十项复发);当前页 aria-current +const nav = [ + { href: '/archives/', label: '文章' }, + { href: '/gallery/', label: '图库' }, + { href: '/about/', label: '关于' }, +]; +const path = Astro.url.pathname; +const isCurrent = (href: string) => + path === href || path === href.replace(/\/$/, '') || path.startsWith(href); +--- + + + + diff --git a/src/components/ThemeScript.astro b/src/components/ThemeScript.astro new file mode 100644 index 0000000..e3ab50b --- /dev/null +++ b/src/components/ThemeScript.astro @@ -0,0 +1,14 @@ +--- +// 明暗不闪烁脚本: 内联、先于首帧。 +// 优先级:用户手选(localStorage) > 系统偏好;切换按钮(T7 键盘/组件)写同一 key。 +--- + + diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro new file mode 100644 index 0000000..b89774e --- /dev/null +++ b/src/layouts/BaseLayout.astro @@ -0,0 +1,44 @@ +--- +// 基础布局:字体/样式统一在此持有(页面不再各自引包) +// 明暗不闪烁:ThemeScript 必须在 内联先于首帧执行 +import 'lxgw-wenkai-screen-webfont/lxgwwenkaiscreen.css'; +import '@fontsource/noto-sans-sc/400.css'; +import '@fontsource/noto-sans-sc/500.css'; +import '@fontsource/noto-sans-sc/700.css'; +import '@fontsource/jetbrains-mono/400.css'; +import '@fontsource/jetbrains-mono/700.css'; +import '../styles/global.css'; +import Header from '../components/Header.astro'; +import Footer from '../components/Footer.astro'; +import ThemeScript from '../components/ThemeScript.astro'; + +interface Props { + title: string; + description?: string; + /** 正文轨:reading 书评纸墨 / tech 技术(body 级字体氛围) */ + track?: 'reading' | 'tech'; +} +const { title, description = 'wait4x 的博客:阅读 · 技术 · 摄影', track = 'tech' } = Astro.props; +--- + + + + + + + + + + + {title} + + + + +
+
+ +
+