mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-01 19:27:48 +02:00
fix : formatted docs with prettier
This commit is contained in:
parent
f98adef040
commit
af8c0b4839
3 changed files with 22 additions and 27 deletions
|
@ -2,24 +2,19 @@
|
||||||
title: Deploy your site
|
title: Deploy your site
|
||||||
---
|
---
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
|
||||||
import TabItem from '@theme/TabItem';
|
|
||||||
|
|
||||||
This page will discuss multiple options available when it comes to
|
This page will discuss multiple options available when it comes to deploying your docs site. Before even this happens, you need to build the files of your website for production. To do this, run :
|
||||||
deploying your docs site. Before even this happens, you need to build the files
|
|
||||||
of your website for production. To do this, run :
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
The static files will be generate in the build/ directory.
|
The static files will be generate in the build/ directory.
|
||||||
|
|
||||||
## Self Hosting
|
## Self Hosting
|
||||||
|
|
||||||
:::warning
|
:::warning It is not the most performant solution :::
|
||||||
It is not the most performant solution
|
|
||||||
:::
|
|
||||||
|
|
||||||
|
|
||||||
Docusaurus can be self hosted with docusaurus serve. Change your `--port` and `--host` to match appropriately.
|
Docusaurus can be self hosted with docusaurus serve. Change your `--port` and `--host` to match appropriately.
|
||||||
|
|
||||||
|
@ -28,7 +23,9 @@ npm run serve --build --port 80 --host 0.0.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Deploying to Netlify
|
## Deploying to Netlify
|
||||||
|
|
||||||
One of the fastest ways to deploy is through [Netlify](https://www.netlify.com/). Configure your `docusaurus.config.js`
|
One of the fastest ways to deploy is through [Netlify](https://www.netlify.com/). Configure your `docusaurus.config.js`
|
||||||
|
|
||||||
```js {2-3} title="docusaurus.config.js"
|
```js {2-3} title="docusaurus.config.js"
|
||||||
module.exports = {
|
module.exports = {
|
||||||
url: 'https://docusaurus-2.netlify.com', // Url to your site with no trailing slash
|
url: 'https://docusaurus-2.netlify.com', // Url to your site with no trailing slash
|
||||||
|
|
|
@ -2,27 +2,24 @@
|
||||||
title: Manage Versions
|
title: Manage Versions
|
||||||
---
|
---
|
||||||
|
|
||||||
Docusaurus gives you the option to have different versions of your docs,
|
Docusaurus gives you the option to have different versions of your docs, allowing you to update and have previous versions available.
|
||||||
allowing you to update and have previous versions available.
|
|
||||||
|
|
||||||
|
|
||||||
### Tagging a new version
|
### Tagging a new version
|
||||||
To tag a new version make sure the content in the `docs` directory is ready to be
|
|
||||||
frozen as a version. Run the following command to tag a version
|
|
||||||
|
|
||||||
|
To tag a new version make sure the content in the `docs` directory is ready to be frozen as a version. Run the following command to tag a version
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run docusaurus docs:version <version>
|
npm run docusaurus docs:version <version>
|
||||||
```
|
```
|
||||||
|
|
||||||
When a new `version` is tagged, the `docs/` directory content will be copied into `versioned_docs/version-<version>/` folder. A [sidebar](https://v2.docusaurus.io/docs/docs-introduction#sidebar) configuration will also be copiend and the version number added to `versions.json`.
|
When a new `version` is tagged, the `docs/` directory content will be copied into `versioned_docs/version-<version>/` folder. A [sidebar](https://v2.docusaurus.io/docs/docs-introduction#sidebar) configuration will also be copiend and the version number added to `versions.json`.
|
||||||
|
|
||||||
## Updating an existing version
|
## Updating an existing version
|
||||||
You can edit any version in its specific folder, comit and push changes and it will be published to that version.
|
|
||||||
Example when you change any file in `versioned_docs/version-2.6/`, it will only affect the docs for `version 2.6`
|
|
||||||
|
|
||||||
|
You can edit any version in its specific folder, comit and push changes and it will be published to that version. Example when you change any file in `versioned_docs/version-2.6/`, it will only affect the docs for `version 2.6`
|
||||||
|
|
||||||
## Deleting an existing version
|
## Deleting an existing version
|
||||||
You can delete an existing version by removing the version from `versions.json` file, deleting the docs directory,
|
|
||||||
Example : `versioned_docs/version-1.8.0` and deleting the versioned sidebar file, Example : `versioned_sidebars/version-1.8.0-sidebars.json`.
|
You can delete an existing version by removing the version from `versions.json` file, deleting the docs directory, Example : `versioned_docs/version-1.8.0` and deleting the versioned sidebar file, Example : `versioned_sidebars/version-1.8.0-sidebars.json`.
|
||||||
|
|
||||||
After tagging a new version or deleting an existing version, you can restart the site with `yarn restart` or `npm restart`.
|
After tagging a new version or deleting an existing version, you can restart the site with `yarn restart` or `npm restart`.
|
|
@ -2,10 +2,10 @@
|
||||||
title: Translate your site
|
title: Translate your site
|
||||||
---
|
---
|
||||||
|
|
||||||
In this page we would cover translate .md files. We are going to translate the
|
In this page we would cover translate .md files. We are going to translate the `Getting Started` page in the `Docusaurus Tutorial section` to French - "fr".
|
||||||
`Getting Started` page in the `Docusaurus Tutorial section` to French - "fr".
|
|
||||||
|
|
||||||
### Site Configuration
|
### Site Configuration
|
||||||
|
|
||||||
Use the [site i18n configuration](https://v2.docusaurus.io/docs/next/docusaurus.config.js#i18n) to add the fr locale"
|
Use the [site i18n configuration](https://v2.docusaurus.io/docs/next/docusaurus.config.js#i18n) to add the fr locale"
|
||||||
|
|
||||||
```js title="docusaurus.config.js"
|
```js title="docusaurus.config.js"
|
||||||
|
@ -26,10 +26,11 @@ module.exports = {
|
||||||
```
|
```
|
||||||
|
|
||||||
### Translate the page
|
### Translate the page
|
||||||
|
|
||||||
To Transte the `getting-started.md` page, copy `docs/getting-started.md` to `i18n/fr/plugin-docs/getting-started.md`. Replace the content in the i118n folder with the French locale content.
|
To Transte the `getting-started.md` page, copy `docs/getting-started.md` to `i18n/fr/plugin-docs/getting-started.md`. Replace the content in the i118n folder with the French locale content.
|
||||||
|
|
||||||
|
|
||||||
### Start your site
|
### Start your site
|
||||||
|
|
||||||
Start your localized site in dev mode, using the fr local.
|
Start your localized site in dev mode, using the fr local.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
Loading…
Add table
Reference in a new issue