Skip to content

Commit

Permalink
fix : formatted docs with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelships committed Mar 16, 2021
1 parent f98adef commit af8c0b4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
---
title: Deploy your site
title: Deploy your site
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

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 :
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 :

```bash
npm run build
```

The static files will be generate in the build/ directory.

## Self Hosting

:::warning
It is not the most performant solution
:::

:::warning It is not the most performant solution :::

Docusaurus can be self hosted with docusaurus serve. Change your `--port` and `--host` to match appropriately.

Expand All @@ -28,7 +23,9 @@ npm run serve --build --port 80 --host 0.0.0.0
```

## Deploying to Netlify

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"
module.exports = {
url: 'https://docusaurus-2.netlify.com', // Url to your site with no trailing slash
Expand All @@ -39,4 +36,4 @@ module.exports = {

After you're done, [setup your site with Netlify](https://app.netlify.com/start).

Your site should now automatically deploy when ever you merge into your deploy branch, which defaults to master.
Your site should now automatically deploy when ever you merge into your deploy branch, which defaults to master.
21 changes: 9 additions & 12 deletions packages/docusaurus-init/templates/classic/docs/manage-versions.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
---
title: Manage Versions
title: Manage Versions
---

Docusaurus gives you the option to have different versions of your docs,
allowing you to update and have previous versions available.

Docusaurus gives you the option to have different versions of your docs, allowing you to update and have previous versions available.

### 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>
```

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
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
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`.
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`.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: Translate your site
---

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".
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".

### Site Configuration

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"
Expand All @@ -26,13 +26,14 @@ module.exports = {
```

### 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 localized site in dev mode, using the fr local.

```bash
```bash
npm run start -- --locale fr
```

Expand Down

0 comments on commit af8c0b4

Please sign in to comment.