Настройка сайта
Установив Docusaurus, вы получили основу для работы над вашим конкретным сайтом. Далее обсуждается остальная часть структуры Docusaurus в рамках подготовки вашего сайта к запуску.
Структура каталогов
Как было показано после установки Docusaurus, сценарий инициализации создал примерно такую структуру каталогов:
root-directory
├── .gitignore
├── docs
│ ├── doc1.md
│ ├── doc2.md
│ ├── doc3.md
│ ├── exampledoc4.md
│ └── exampledoc5.md
└── website
├── blog
│ ├── 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
Описание каталогов
- Documentation Source Files: The
docs
directory contains example documentation files written in Markdown. - Blog: The
website/blog
directory contains examples of blog posts written in markdown. - Страницы: Каталог
website/pages
содержит образцы высокоуровневых страниц для сайта. - Статические файлы и изображения: Каталог
website/static
содержит статические ресурсы, используемые в образце сайта.
Ключевые файлы
- Footer: The
website/core/Footer.js
file is a React component that acts as the footer for the site generated by Docusaurus and should be customized by the user. - Configuration file: The
website/siteConfig.js
file is the main configuration file used by Docusaurus. - Sidebars: The
sidebars.json
file contains the structure and order of the documentation files. - .gitignore: The
.gitignore
file lists the necessary ignore files for the generated site so that they do not get added to the git repo.
Подготовка
You will need to keep the website/siteConfig.js
and website/core/Footer.js
files but may edit them as you wish. Значение поля customDocsPath
в website/siteConfig.js
может быть изменено по вашему желанию для использования другого наименования каталога или пути. Каталог website
также может быть переименован во что угодно при необходимости.
Тем не менее, вам следует сохранить каталоги website/pages
и website/static
. Вы можете изменить их содержимое по своему желанию. At the bare minimum, you should have an en/index.js
or en/index.html
file inside website/pages
and an image to use as your header icon inside website/static
.
If your directory does not yet have a .gitignore
, we generate it with the necessary ignored files listed. As a general rule, you should ignore all node_modules
, build files, system files (.DS_Store
), logs, etc. Here is a more comprehensive list of what is normally ignored for Node.js projects.