kuailu-blog ·

博客底层迁移至 Astro 核心与内容集合 schema 配置

将旧版静态资源与 Bear Blog 样式骨架合并入 Astro,使用 TS 定义了 blog 与 diary 两个核心内容集合(Content Collections),并通过 Zod 对 Frontmatter 元数据字段进行了严密的静态校验配置。

Git Commit: 3f2e1a5

今日工作内容:

  1. Astro 基础架构集成

    • 导入了基于 Cormorant GaramondInter 字体族的本地字体系统,避免了远程 CDN 加载带来的首屏无样式文字抖动(FOUT)。
    • 将 Bear Blog 的 MIT 经典 global 样式表引入 src/styles/global.css 并完成了基础 OKLCH 调色盘重映射。
  2. 内容校验模型定义

    • src/content.config.ts 中声明了两个双内容流集合:
      • blog 集合:校验 titledescriptionpubDateheroImage 以及可选的 category
      • diary 集合:专门面向 GitHub 项目提交日志,强制校验 projectNamesummary 以及可选的 gitCommit
    • 这套 Zod 静态校验能确保任何格式有误的文章都会在 npm run build 静态打包时直接拦截报错,保证生产产物的绝对健壮。