Site Preparation
Depois de instalar o Docusaurus, você já deve ter uma estrutura pronta que você pode usar para começar a trabalhar no seu site específico. Vamos passar agora pelo resto da estrutura do Docusaurus para que você prepare seu site.
Estrutura de diretórios
Como visto após você instalar o Docusaurus, o script de inicialização criou uma estrutura de diretórios semelhante a esta:
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
Descrição dos diretórios
- Documentation Source Files: The
docsdirectory contains example documentation files written in Markdown. - Blog: The
website/blogdirectory contains examples of blog posts written in markdown. - Páginas: O diretório
website/pagescontém exemplos de páginas de nível superior para o site. - Arquivos estáticos e imagens: O diretório
website/staticcontém assets estáticos usados pelo site de exemplo.
Arquivos importantes
- Footer: The
website/core/Footer.jsfile 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.jsfile is the main configuration file used by Docusaurus. - Barras laterais: O arquivo
sidebars.jsoncontém a estrutura e ordenação dos arquivos da documentação. - .gitignore: The
.gitignorefile lists the necessary ignore files for the generated site so that they do not get added to the git repo.
Observações sobre a preparação
Você vai precisar manter os arquivos website/siteConfig.js e website/core/Footer.js, mas pode editá-los como quiser. 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. No mínimo, você precisa ter um arquivo en/index.js ou en/index.html dentro de website/pages e uma imagem para usar como seu ícone de cabeçalho dentro de 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.