From af8c0b48396ea40e7aea8421b601e802364ad720 Mon Sep 17 00:00:00 2001 From: besemuna Date: Tue, 16 Mar 2021 19:21:09 +0000 Subject: [PATCH] fix : formatted docs with prettier --- .../classic/docs/deploy-your-site.md | 19 +++++++---------- .../templates/classic/docs/manage-versions.md | 21 ++++++++----------- .../classic/docs/translate-your-site.md | 9 ++++---- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/packages/docusaurus-init/templates/classic/docs/deploy-your-site.md b/packages/docusaurus-init/templates/classic/docs/deploy-your-site.md index 6046fbee8a31..b898d24f362c 100644 --- a/packages/docusaurus-init/templates/classic/docs/deploy-your-site.md +++ b/packages/docusaurus-init/templates/classic/docs/deploy-your-site.md @@ -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. @@ -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 @@ -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. \ No newline at end of file +Your site should now automatically deploy when ever you merge into your deploy branch, which defaults to master. diff --git a/packages/docusaurus-init/templates/classic/docs/manage-versions.md b/packages/docusaurus-init/templates/classic/docs/manage-versions.md index 6fe8e6fd00b6..c2c512c05e06 100644 --- a/packages/docusaurus-init/templates/classic/docs/manage-versions.md +++ b/packages/docusaurus-init/templates/classic/docs/manage-versions.md @@ -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 ``` + When a new `version` is tagged, the `docs/` directory content will be copied into `versioned_docs/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`. \ No newline at end of file +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`. diff --git a/packages/docusaurus-init/templates/classic/docs/translate-your-site.md b/packages/docusaurus-init/templates/classic/docs/translate-your-site.md index 7cd1479c7187..8b0cef7a020d 100644 --- a/packages/docusaurus-init/templates/classic/docs/translate-your-site.md +++ b/packages/docusaurus-init/templates/classic/docs/translate-your-site.md @@ -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" @@ -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 ```