Site Preparation
在 安装 Docusaurus之后, 您现在有了一个特定网站的可用骨架。 下面将讨论 Docusaurus 结构的其余部分, 以便您准备建站。
目录结构
正如安装 Docusaurus后所示, 初始化脚本创建了一个类似于以下内容的目录结构:
root-directory
├── docs-examples-from-docusaurus
│ ├── doc1.md
│ ├── doc2.md
│ ├── doc3.md
│ ├── exampledoc4.md
│ └── exampledoc5.md
└── website
├── blog-examples-from-docusaurus
│ ├── 2016-03-11-blog-post.md
│ ├── 2017-04-10-blog-post-two.md
│ ├── 2017-09-25-testing-rss.md
│ ├── 2017-09-26-adding-rss.md
│ └── 2017-10-24-new-version-1.0.0.md
├── core
│ └── Footer.js
├── package.json
├── pages
├── sidebars.json
├── siteConfig.js
└── static
在 verified the installation 步骤后,你可能已经重命名了博客(
website/blog-examples-from-docusaurus
重名为website/blog
)与文档文件夹(docs-examples-from-docusaurus
重名为docs
)。
目录介绍
- 文档源文件:包含可编写的 Markdown 示例文件的文件夹
docs-examples-from-docusaurus
。 - 博客:包含了可编写的 Markdown 示例文章的文件夹
website/blog-examples-from-docusaurus
。 - 页面:包含示例网站顶级页面的文件夹
website/pages
。 - 静态资源与图片:包含供网站使用的静态资源文件夹
website/static
。
关键文件
- 页脚:
website/core/Footer.js
文件是一个 React 组件,用于生成 Docusaurus 站点的页脚,它可以由用户定制。 - 配置文件:
website/siteConfig.js
文件是 Docusaurus 的主配置文件。 - 工具栏:
sidebars.json
文件包含文档文件的结构与排序。
准备说明
您不能删除 website/siteConfig.js
和 website/core/Footer.js
文件, 但可以按您的意愿编辑它们。 The value of the customDocsPath
key in website/siteConfig.js
can be modified if you wish to use a different directory name or path. The website
directory can also be renamed to anything you want it to be.
However, you should keep the website/pages
and website/static
directories. You may change the content inside them as you wish. 在 website/pages
目录,你至少应该有一个 en/index.js
或 en/index.html
以及在website/static
里有一个图片作为您的页眉图标(header icon) 。