← thoughts

30 · April · MMXXVI

怎么写新文章

新文章放在 src/content/blog/ 目录下,文件名就是 URL(比如 my-post.md/blog/my-post/)。

必填字段

每篇文章顶部需要这样一段 frontmatter:

---
title: "标题"
description: "一句话描述(用于 SEO 和首页摘要)"
pubDate: "2026-04-30"
---

选填字段

  • updatedDate: "2026-05-01" — 更新日期
  • heroImage: "../../assets/封面.jpg" — 封面图(放在 src/assets/ 下)
  • draft: true — 草稿模式。标了 true 的文章不会出现在博客上,即使 push 到仓库也不会构建到生产网站。写完想发布时改成 false(或删掉这行)。

Markdown 速查

加粗 斜体 行内代码

引用块

  • 列表项 1
  • 列表项 2

链接

console.log("代码块");

写完以后:

git add .
git commit -m "新文章:xxx"
git push

Cloudflare Pages 会自动构建发布,大概 1-2 分钟后就能在 ciwiciwi.com 看到。