写作入门
欢迎!这篇文章演示怎么写一篇文章。
一篇文章就是一个文件
Section titled “一篇文章就是一个文件”- 在
src/content/docs/下新建一个.md(或.mdx)文件 - 文件顶部写一段 frontmatter(两个
---之间) - 下面写 Markdown 正文
frontmatter 是什么
Section titled “frontmatter 是什么”文件顶部这一段 YAML:
---title: 文章标题description: 一句话描述,会显示在搜索结果和 SEO 里sidebar: order: 1 # 侧边栏里的排序,数字越小越靠上---文章正文里用 ##、### 做小标题。Starlight 会自动用它们生成右侧目录。
用三个反引号包裹,自动高亮 + 显示复制按钮:
console.log('Hello, world!');def hello(): print("Hello, world!")写完这篇,去看 第二篇:怎么组织一个教程.