Astro 博客文章格式
blog.mengdis.com 的文章采用 Astro Content Collections。新增文章时,在 src/content/blog/ 下创建一个 .md 或 .mdx 文件即可。
基本格式如下:
---
title: '文章标题'
description: '文章摘要,会显示在列表和 SEO 描述里。'
pubDate: '2026-05-13'
tags:
- astro
- note
---
正文从这里开始。
文件名会成为文章地址的一部分。例如:
src/content/blog/2026/astro/astro-post-format.md
会生成:
https://blog.mengdis.com/blog/2026/astro/astro-post-format/
后续如果需要放图片,可以先把图片放到 src/assets/ 或 public/images/,再在文章中引用。文章写完后运行部署脚本,服务器会生成新的 release 并更新 ~/sites/blog/current。