感谢作者的贡献 jktrn/astro-erudite。对比了许多的主题,还是这个最符合口味。
创建博文
创建 /src/content/blog/标题/index.mdx
许多组件需要mdx
,不需要组件正常写md
内容也可以
子帖
在 index.mdx
同级目录下再创建一个 子帖标题.mdx
,博文右边就会出现子帖。
子帖 跟博文属于同等级,frnotmatter也要写
frontmatter
必填只有三个标题、备注、日期
Field | Type (Zod) | Requirements | Required |
---|---|---|---|
title | string | Should be ≤60 characters. | Yes |
description | string | Should be ≤155 characters. | Yes |
date | coerce.date() | Must be in YYYY-MM-DD format. | Yes |
image | image() | Should be exactly 1200px × 630px. | Optional |
tags | string[] | Preferably use kebab-case for these. | Optional |
authors | string[] | If the author has a profile, use the id associated with their Markdown file in src/content/authors/ (e.g. if their file is named jane-doe.md , use jane-doe in the array). | Optional |
draft | boolean | Defaults to false if not provided. | Optional |
标题
## 标题### 二级标题#### 三级标题
标注 Callout
需要 .mdx
并导入 import Callout from '@/components/Callout.astro'
Note (标注演示)
这里面可以是markdown语法
,
<Callout title="标注演示" variant="note"> 这里面可以是`markdown语法`,</Callout>
更多样式 v1.5.0: “A Callout Component for Nerds”
headless CMS
无头CMS基于Git管理的后胎CMS编辑,无需服务器。