skip to content
杨鸿肇 杨鸿肇
/ EN

技术样例 · Astro 内容层 API 小记

/ 1 min read

Table of Contents

这是一篇放在 技术 分区的样例博客,主要用于验证博客卡片的标题、标签和时间排版。正式内容会在后续博文里补上。

代码示例

// src/content.config.ts(节选)
const post = defineCollection({
loader: glob({ base: "./src/content/post", pattern: "**/*.{md,mdx}" }),
schema: ({ image: _image }) =>
z.object({
title: z.string().max(80),
description: z.string(),
category: z.enum(["tech", "misc"]).default("tech"),
}),
});

想法清单

  • 实际内容:Astro Content Layer 迁移要点、性能数据
  • 后续文章:i18n 字典组织、博客卡片设计迭代
  • 相关链接:项目页关于页