Skip to main content

创建一篇博客文章

Docusaurus 会为 每篇博客文章创建一个页面, 同时还会创建一个 博客索引页, 一个 标签系统, 一个 RSS 订阅源 等等。

创建你的第一篇文章

新建一个文件: blog/2021-02-28-greetings.md:

blog/2021-02-28-greetings.md
---
slug: greetings
title: Greetings!
authors:
- name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
- name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
tags: [greetings]
---

恭喜,你已经完成了你的第一篇文章!

你可以随意操作,按照自己的喜好编辑这篇文章。

现在,一篇新的博客文章可以在 http://localhost:3000/blog/greetings 这个网址查看。

关于上面 blog/2021-02-28-greetings.md 文件内容的一些解释:

blog/2021-02-28-greetings.md 文件内容解释
---
slug: greetings // 文章别名,在 URL 中使用,没定别名的话,通过 /blog/2021/02/28/greetings 访问,定义别名后可通过 /blog/greetings 访问。
title: Greetings! // 文章标题
authors: // 文章作者,可写多个作者
- name: Joel Marcey // 作者名称
title: Co-creator of Docusaurus 1 // 作者头衔
url: https://github.com/JoelMarcey // 作者 github 链接
image_url: https://github.com/JoelMarcey.png // 作者头像链接
- name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
tags: [greetings] // 文章标签,可写多个标签
---
// 以下是文章内容

恭喜,你已经完成了你的第一篇文章!

你可以随意操作,按照自己的喜好编辑这篇文章。