Demo
Example One
这是一篇示例内容页(TODO(setup):换成你的正文)。它由
src/content/pages/example-one.md 提供,文件名 example-one 即路由 slug
/example-one——不需要在别处登记路由或 sitemap。
页面工厂怎么用
丢一个同目录 .md 文件就新增一页:src/pages/[slug].astro 从集合 getStaticPaths
自动收录,@astrojs/sitemap 自动把预渲染页写进 sitemap。集合 schema(src/content.config.ts)
在 build 时用 zod 逐条校验 frontmatter,缺字段直接构建失败——白名单与内容源合一。
正文走 markdown,编译后套 .markdown-body 全局样式(design-system/typography.css)。