mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
refactor: rename Git master branch to main (#5345)
* Prepare to renaming master branch to main * Update CONTRIBUTING.md * Update packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/package.json * Update packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/package.json * Update packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/package.json * missing master -> main replaces * useless char * For GH Pages org deploy, DEPLOYMENT_BRANCH env is now required * fix versioning page * fix vercel links * update deployment.mdx Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
33a85c71aa
commit
8341527fc9
77 changed files with 230 additions and 206 deletions
2
.github/ISSUE_TEMPLATE/bug.md
vendored
2
.github/ISSUE_TEMPLATE/bug.md
vendored
|
@ -39,7 +39,7 @@ This way we know you've done these steps first.
|
||||||
|
|
||||||
(A clear and concise description of what the bug is.)
|
(A clear and concise description of what the bug is.)
|
||||||
|
|
||||||
### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#reporting-new-issues)?
|
### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues)?
|
||||||
|
|
||||||
(Write your answer here.)
|
(Write your answer here.)
|
||||||
|
|
||||||
|
|
2
.github/ISSUE_TEMPLATE/feature.md
vendored
2
.github/ISSUE_TEMPLATE/feature.md
vendored
|
@ -15,7 +15,7 @@ labels: 'feature, needs triage'
|
||||||
|
|
||||||
(A clear and concise description of what the feature is.)
|
(A clear and concise description of what the feature is.)
|
||||||
|
|
||||||
### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#reporting-new-issues)?
|
### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues)?
|
||||||
|
|
||||||
(Write your answer here.)
|
(Write your answer here.)
|
||||||
|
|
||||||
|
|
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -3,7 +3,7 @@ Thank you for sending the PR! We appreciate you spending the time to work on the
|
||||||
|
|
||||||
Help us understand your motivation by explaining why you decided to make this change.
|
Help us understand your motivation by explaining why you decided to make this change.
|
||||||
|
|
||||||
You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md
|
You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md
|
||||||
|
|
||||||
Happy contributing!
|
Happy contributing!
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ Happy contributing!
|
||||||
|
|
||||||
(Write your motivation here.)
|
(Write your motivation here.)
|
||||||
|
|
||||||
### Have you read the [Contributing Guidelines on pull requests](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#pull-requests)?
|
### Have you read the [Contributing Guidelines on pull requests](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#pull-requests)?
|
||||||
|
|
||||||
(Write your answer here.)
|
(Write your answer here.)
|
||||||
|
|
||||||
|
|
4
.github/workflows/canary-release.yml
vendored
4
.github/workflows/canary-release.yml
vendored
|
@ -3,7 +3,7 @@ name: Canary Release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'packages/**'
|
- 'packages/**'
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ jobs:
|
||||||
git config --global user.name "Docusaurus Canary"
|
git config --global user.name "Docusaurus Canary"
|
||||||
git config --global user.email "canary@docusaurus.io"
|
git config --global user.email "canary@docusaurus.io"
|
||||||
git fetch
|
git fetch
|
||||||
git checkout master
|
git checkout main
|
||||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
|
||||||
cat .npmrc
|
cat .npmrc
|
||||||
echo "npm whoami"
|
echo "npm whoami"
|
||||||
|
|
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
|
@ -3,7 +3,7 @@ name: Lint
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
|
|
2
.github/workflows/v2-build-blog-only.yml
vendored
2
.github/workflows/v2-build-blog-only.yml
vendored
|
@ -3,7 +3,7 @@ name: V2 Build Blog-only
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'website-1.x/blog/**'
|
- 'website-1.x/blog/**'
|
||||||
- 'packages/docusaurus/**'
|
- 'packages/docusaurus/**'
|
||||||
|
|
3
.github/workflows/v2-build-size-report.yml
vendored
3
.github/workflows/v2-build-size-report.yml
vendored
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
name: V2 Build Size Report
|
name: V2 Build Size Report
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
@ -9,7 +8,7 @@ on:
|
||||||
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests
|
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'website-1.x/**'
|
- 'website-1.x/**'
|
||||||
- 'packages/docusaurus-1.x/**'
|
- 'packages/docusaurus-1.x/**'
|
||||||
|
|
3
.github/workflows/v2-build-time-perf.yml
vendored
3
.github/workflows/v2-build-time-perf.yml
vendored
|
@ -3,7 +3,7 @@ name: V2 Build Time Perf
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'website/docs/**'
|
- 'website/docs/**'
|
||||||
- 'website-1.x/**'
|
- 'website-1.x/**'
|
||||||
|
@ -31,5 +31,4 @@ jobs:
|
||||||
- name: Build (warm cache)
|
- name: Build (warm cache)
|
||||||
run: yarn workspace docusaurus-2-website build --locale en
|
run: yarn workspace docusaurus-2-website build --locale en
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
|
|
||||||
# TODO post a Github comment with build with perf warnings?
|
# TODO post a Github comment with build with perf warnings?
|
||||||
|
|
2
.github/workflows/v2-lighthouse-report.yml
vendored
2
.github/workflows/v2-lighthouse-report.yml
vendored
|
@ -3,7 +3,7 @@ name: V2 Lighthouse Report
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'website-1.x/**'
|
- 'website-1.x/**'
|
||||||
- 'packages/docusaurus-1.x/**'
|
- 'packages/docusaurus-1.x/**'
|
||||||
|
|
8
.github/workflows/v2-tests-e2e.yml
vendored
8
.github/workflows/v2-tests-e2e.yml
vendored
|
@ -3,10 +3,10 @@ name: V2 Tests E2E
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'website-1.x/**'
|
- 'website-1.x/**'
|
||||||
- 'packages/docusaurus-1.x/**'
|
- 'packages/docusaurus-1.x/**'
|
||||||
|
@ -29,7 +29,7 @@ jobs:
|
||||||
uses: bahmutov/npm-install@v1
|
uses: bahmutov/npm-install@v1
|
||||||
with:
|
with:
|
||||||
install-command: yarn
|
install-command: yarn
|
||||||
- name: Generate test-website project against master release
|
- name: Generate test-website project against main branch
|
||||||
run: |
|
run: |
|
||||||
KEEP_CONTAINER=true yarn test:build:v2 -s
|
KEEP_CONTAINER=true yarn test:build:v2 -s
|
||||||
mv test-website ../test-website
|
mv test-website ../test-website
|
||||||
|
@ -66,7 +66,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
install-command: yarn
|
install-command: yarn
|
||||||
|
|
||||||
- name: Generate test-website project against master release
|
- name: Generate test-website project against main branch
|
||||||
run: |
|
run: |
|
||||||
KEEP_CONTAINER=true yarn test:build:v2 -s
|
KEEP_CONTAINER=true yarn test:build:v2 -s
|
||||||
mv test-website ../test-website
|
mv test-website ../test-website
|
||||||
|
|
2
.github/workflows/v2-tests-windows.yml
vendored
2
.github/workflows/v2-tests-windows.yml
vendored
|
@ -3,7 +3,7 @@ name: V2 Windows Tests
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'website-1.x/**'
|
- 'website-1.x/**'
|
||||||
- 'packages/docusaurus-1.x/**'
|
- 'packages/docusaurus-1.x/**'
|
||||||
|
|
2
.github/workflows/v2-tests.yml
vendored
2
.github/workflows/v2-tests.yml
vendored
|
@ -3,7 +3,7 @@ name: V2 Tests
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'website-1.x/**'
|
- 'website-1.x/**'
|
||||||
- 'packages/docusaurus-1.x/**'
|
- 'packages/docusaurus-1.x/**'
|
||||||
|
|
|
@ -57,7 +57,7 @@ When a change made on GitHub is approved, it will be checked by our continuous i
|
||||||
|
|
||||||
### Branch Organization
|
### Branch Organization
|
||||||
|
|
||||||
Docusaurus has one primary branches `master` and we use feature branches with deploy previews to deliver new features with pull requests.
|
Docusaurus has one primary branch `main` and we use feature branches with deploy previews to deliver new features with pull requests.
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ We use [GitHub Issues](https://github.com/facebook/docusaurus/issues) for our pu
|
||||||
|
|
||||||
If you have questions about using Docusaurus, contact the Docusaurus Twitter account at [@docusaurus](https://twitter.com/docusaurus), and we will do our best to answer your questions.
|
If you have questions about using Docusaurus, contact the Docusaurus Twitter account at [@docusaurus](https://twitter.com/docusaurus), and we will do our best to answer your questions.
|
||||||
|
|
||||||
You can also file issues as [feature requests or enhancements](https://github.com/facebook/docusaurus/labels/feature%20request). If you see anything you'd like to be implemented, create an issue with [feature template](https://raw.githubusercontent.com/facebook/docusaurus/master/.github/ISSUE_TEMPLATE/feature.md)
|
You can also file issues as [feature requests or enhancements](https://github.com/facebook/docusaurus/labels/feature%20request). If you see anything you'd like to be implemented, create an issue with [feature template](https://raw.githubusercontent.com/facebook/docusaurus/main/.github/ISSUE_TEMPLATE/feature.md)
|
||||||
|
|
||||||
## Reporting New Issues
|
## Reporting New Issues
|
||||||
|
|
||||||
|
@ -125,14 +125,14 @@ Small pull requests are much easier to review and more likely to get merged. Mak
|
||||||
|
|
||||||
Please make sure the following is done when submitting a pull request:
|
Please make sure the following is done when submitting a pull request:
|
||||||
|
|
||||||
1. Fork [the repository](https://github.com/facebook/docusaurus) and create your branch from `master`.
|
1. Fork [the repository](https://github.com/facebook/docusaurus) and create your branch from `main`.
|
||||||
1. Add the copyright notice to the top of any code new files you've added.
|
1. Add the copyright notice to the top of any code new files you've added.
|
||||||
1. Describe your [**test plan**](#test-plan) in your pull request description. Make sure to [test your changes](https://github.com/facebook/docusaurus/blob/master/admin/testing-changes-on-Docusaurus-itself.md)!
|
1. Describe your [**test plan**](#test-plan) in your pull request description. Make sure to [test your changes](https://github.com/facebook/docusaurus/blob/main/admin/testing-changes-on-Docusaurus-itself.md)!
|
||||||
1. Make sure your code lints (`yarn prettier && yarn lint`).
|
1. Make sure your code lints (`yarn prettier && yarn lint`).
|
||||||
1. Make sure your Jest tests pass (`yarn test`).
|
1. Make sure your Jest tests pass (`yarn test`).
|
||||||
1. If you haven't already, [sign the CLA](https://code.facebook.com/cla).
|
1. If you haven't already, [sign the CLA](https://code.facebook.com/cla).
|
||||||
|
|
||||||
All pull requests should be opened against the `master` branch.
|
All pull requests should be opened against the `main` branch.
|
||||||
|
|
||||||
#### Test Plan
|
#### Test Plan
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ Facebook has adopted a Code of Conduct that we expect project participants to ad
|
||||||
|
|
||||||
### Contributing guide
|
### Contributing guide
|
||||||
|
|
||||||
Read our [contributing guide](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Docusaurus.
|
Read our [contributing guide](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Docusaurus.
|
||||||
|
|
||||||
### Beginner-friendly bugs
|
### Beginner-friendly bugs
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Sometimes you want to test the latest version of Docusaurus on a third-party project via `npm` or `yarn` without having to publish it to npm itself. For example, you may want to use the latest code in `master`.
|
Sometimes you want to test the latest version of Docusaurus on a third-party project via `npm` or `yarn` without having to publish it to npm itself. For example, you may want to use the latest code in `main`.
|
||||||
|
|
||||||
> If you want to use Docusaurus to test Docusaurus, see the [testing changes on Docusaurus itself doc](./testing-changes-on-Docusaurus-itself.md)
|
> If you want to use Docusaurus to test Docusaurus, see the [testing changes on Docusaurus itself doc](./testing-changes-on-Docusaurus-itself.md)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ const PlaygroundConfigs = {
|
||||||
codesandbox: 'https://codesandbox.io/s/docusaurus',
|
codesandbox: 'https://codesandbox.io/s/docusaurus',
|
||||||
|
|
||||||
// stackblitz: 'https://stackblitz.com/fork/docusaurus', // not updated
|
// stackblitz: 'https://stackblitz.com/fork/docusaurus', // not updated
|
||||||
// stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/master/examples/classic', // slow to load
|
// stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/main/examples/classic', // slow to load
|
||||||
stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/starter', // dedicated branch: faster load
|
stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/starter', // dedicated branch: faster load
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -30,13 +30,13 @@ If you're publishing new v2 versions, 2FA might get in the way as the pin might
|
||||||
|
|
||||||
### 1. Git setup
|
### 1. Git setup
|
||||||
|
|
||||||
From the **master branch** (up to date, main repo, not a fork), create a new branch for the release.
|
From the **main branch** (up to date, main repo, not a fork), create a new branch for the release.
|
||||||
|
|
||||||
The branch name does not matter much, but you can use the `<your_username>/<version_to_release>` pattern.
|
The branch name does not matter much, but you can use the `<your_username>/<version_to_release>` pattern.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# up to date master
|
# up to date main
|
||||||
git co master
|
git co main
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
# create a new release branch
|
# create a new release branch
|
||||||
|
|
|
@ -8,9 +8,9 @@ npx @docusaurus/init@latest init examples/<templateName> <templateName>`
|
||||||
|
|
||||||
You can run them in CodeSandbox:
|
You can run them in CodeSandbox:
|
||||||
|
|
||||||
- [classic](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/classic)
|
- [classic](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/classic)
|
||||||
- [bootstrap](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/bootstrap)
|
- [bootstrap](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/bootstrap)
|
||||||
- [facebook](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/facebook)
|
- [facebook](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/facebook)
|
||||||
|
|
||||||
**Tip**: use the [new.docusaurus.io](https://new.docusaurus.io) shortcut.
|
**Tip**: use the [new.docusaurus.io](https://new.docusaurus.io) shortcut.
|
||||||
|
|
||||||
|
|
|
@ -74,14 +74,13 @@ module.exports = {
|
||||||
{
|
{
|
||||||
docs: {
|
docs: {
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
sidebarPath: require.resolve('./sidebars.js'),
|
||||||
editUrl:
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/',
|
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
showReadingTime: true,
|
showReadingTime: true,
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
|
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -91,14 +91,13 @@ module.exports = {
|
||||||
docs: {
|
docs: {
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
sidebarPath: require.resolve('./sidebars.js'),
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/',
|
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
showReadingTime: true,
|
showReadingTime: true,
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
|
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
customCss: require.resolve('./src/css/custom.css'),
|
customCss: require.resolve('./src/css/custom.css'),
|
||||||
|
|
|
@ -126,14 +126,13 @@ module.exports = {
|
||||||
docs: {
|
docs: {
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
sidebarPath: require.resolve('./sidebars.js'),
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/',
|
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
showReadingTime: true,
|
showReadingTime: true,
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
|
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
customCss: require.resolve('./src/css/custom.css'),
|
customCss: require.resolve('./src/css/custom.css'),
|
||||||
|
|
|
@ -125,9 +125,9 @@ function updateStarters() {
|
||||||
|
|
||||||
function run() {
|
function run() {
|
||||||
const branch = execSync('git rev-parse --abbrev-ref HEAD').toString();
|
const branch = execSync('git rev-parse --abbrev-ref HEAD').toString();
|
||||||
if (branch === 'master') {
|
if (branch === 'main') {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Please don't generate Docusaurus examples from the master branch!\nWe are going to commit during this process!",
|
"Please don't generate Docusaurus examples from the main branch!\nWe are going to commit during this process!",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -74,14 +74,13 @@ module.exports = {
|
||||||
{
|
{
|
||||||
docs: {
|
docs: {
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
sidebarPath: require.resolve('./sidebars.js'),
|
||||||
editUrl:
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/',
|
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
showReadingTime: true,
|
showReadingTime: true,
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
|
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -91,14 +91,13 @@ module.exports = {
|
||||||
docs: {
|
docs: {
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
sidebarPath: require.resolve('./sidebars.js'),
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/',
|
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
showReadingTime: true,
|
showReadingTime: true,
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
|
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
customCss: require.resolve('./src/css/custom.css'),
|
customCss: require.resolve('./src/css/custom.css'),
|
||||||
|
|
|
@ -126,14 +126,13 @@ module.exports = {
|
||||||
docs: {
|
docs: {
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
sidebarPath: require.resolve('./sidebars.js'),
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/',
|
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
showReadingTime: true,
|
showReadingTime: true,
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
|
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
customCss: require.resolve('./src/css/custom.css'),
|
customCss: require.resolve('./src/css/custom.css'),
|
||||||
|
|
|
@ -24,7 +24,7 @@ const siteConfig = {
|
||||||
cname: 'docusaurus.io',
|
cname: 'docusaurus.io',
|
||||||
noIndex: false,
|
noIndex: false,
|
||||||
users,
|
users,
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/',
|
||||||
headerLinks: [
|
headerLinks: [
|
||||||
{doc: 'installation', label: 'Docs'},
|
{doc: 'installation', label: 'Docs'},
|
||||||
{doc: 'tutorial-setup', label: 'Tutorial'},
|
{doc: 'tutorial-setup', label: 'Tutorial'},
|
||||||
|
|
|
@ -40,7 +40,7 @@ module.exports = {
|
||||||
homePageId: 'installation',
|
homePageId: 'installation',
|
||||||
showLastUpdateAuthor: true,
|
showLastUpdateAuthor: true,
|
||||||
showLastUpdateTime: true,
|
showLastUpdateTime: true,
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/',
|
||||||
},
|
},
|
||||||
blog: {},
|
blog: {},
|
||||||
theme: {},
|
theme: {},
|
||||||
|
|
|
@ -24,7 +24,7 @@ const siteConfig = {
|
||||||
cname: 'docusaurus.io',
|
cname: 'docusaurus.io',
|
||||||
noIndex: false,
|
noIndex: false,
|
||||||
users,
|
users,
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/',
|
||||||
headerLinks: [
|
headerLinks: [
|
||||||
{doc: 'installation', label: 'Docs'},
|
{doc: 'installation', label: 'Docs'},
|
||||||
{doc: 'tutorial-setup', label: 'Tutorial'},
|
{doc: 'tutorial-setup', label: 'Tutorial'},
|
||||||
|
|
|
@ -24,7 +24,7 @@ const siteConfig = {
|
||||||
cname: 'docusaurus.io',
|
cname: 'docusaurus.io',
|
||||||
noIndex: false,
|
noIndex: false,
|
||||||
users,
|
users,
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/',
|
||||||
headerLinks: [
|
headerLinks: [
|
||||||
{doc: 'installation', label: 'Docs'},
|
{doc: 'installation', label: 'Docs'},
|
||||||
{doc: 'tutorial-setup', label: 'Tutorial'},
|
{doc: 'tutorial-setup', label: 'Tutorial'},
|
||||||
|
|
|
@ -23,7 +23,7 @@ const siteConfig = {
|
||||||
cname: 'docusaurus.io',
|
cname: 'docusaurus.io',
|
||||||
noIndex: true,
|
noIndex: true,
|
||||||
users,
|
users,
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/',
|
||||||
headerLinks: [
|
headerLinks: [
|
||||||
{doc: 'installation', label: 'Docs'},
|
{doc: 'installation', label: 'Docs'},
|
||||||
{doc: 'tutorial-setup', label: 'Tutorial'},
|
{doc: 'tutorial-setup', label: 'Tutorial'},
|
||||||
|
|
|
@ -671,7 +671,7 @@ function migrateVersionedSidebar(
|
||||||
to: `docs/${version}/`,
|
to: `docs/${version}/`,
|
||||||
})),
|
})),
|
||||||
{
|
{
|
||||||
label: 'Master/Unreleased',
|
label: 'Main/Unreleased',
|
||||||
to: `docs/next/`,
|
to: `docs/next/`,
|
||||||
activeBaseRegex: `docs/next/(?!support|team|resources)`,
|
activeBaseRegex: `docs/next/(?!support|team|resources)`,
|
||||||
},
|
},
|
||||||
|
|
|
@ -269,7 +269,7 @@ describe('simple site', () => {
|
||||||
test('docs with editUrl', async () => {
|
test('docs with editUrl', async () => {
|
||||||
const {siteDir, context, options, currentVersion} = await loadSite({
|
const {siteDir, context, options, currentVersion} = await loadSite({
|
||||||
options: {
|
options: {
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ describe('simple site', () => {
|
||||||
slug: '/foo/bazSlug.html',
|
slug: '/foo/bazSlug.html',
|
||||||
title: 'baz',
|
title: 'baz',
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/docs/foo/baz.md',
|
'https://github.com/facebook/docusaurus/edit/main/website/docs/foo/baz.md',
|
||||||
description: 'Images',
|
description: 'Images',
|
||||||
frontMatter: {
|
frontMatter: {
|
||||||
id: 'baz',
|
id: 'baz',
|
||||||
|
@ -744,7 +744,7 @@ describe('versioned site', () => {
|
||||||
test('translated doc with editUrl', async () => {
|
test('translated doc with editUrl', async () => {
|
||||||
const {siteDir, context, options, version100} = await loadSite({
|
const {siteDir, context, options, version100} = await loadSite({
|
||||||
options: {
|
options: {
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',
|
||||||
// editCurrentVersion: true,
|
// editCurrentVersion: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -770,14 +770,14 @@ describe('versioned site', () => {
|
||||||
source:
|
source:
|
||||||
'@site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
'@site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/versioned_docs/version-1.0.0/hello.md',
|
'https://github.com/facebook/docusaurus/edit/main/website/versioned_docs/version-1.0.0/hello.md',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('translated en doc with editUrl and editCurrentVersion=true', async () => {
|
test('translated en doc with editUrl and editCurrentVersion=true', async () => {
|
||||||
const {siteDir, context, options, version100} = await loadSite({
|
const {siteDir, context, options, version100} = await loadSite({
|
||||||
options: {
|
options: {
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',
|
||||||
editCurrentVersion: true,
|
editCurrentVersion: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -803,14 +803,14 @@ describe('versioned site', () => {
|
||||||
source:
|
source:
|
||||||
'@site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
'@site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/docs/hello.md',
|
'https://github.com/facebook/docusaurus/edit/main/website/docs/hello.md',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('translated fr doc with editUrl and editLocalizedFiles=true', async () => {
|
test('translated fr doc with editUrl and editLocalizedFiles=true', async () => {
|
||||||
const {siteDir, context, options, version100} = await loadSite({
|
const {siteDir, context, options, version100} = await loadSite({
|
||||||
options: {
|
options: {
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',
|
||||||
editLocalizedFiles: true,
|
editLocalizedFiles: true,
|
||||||
},
|
},
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
|
@ -837,14 +837,14 @@ describe('versioned site', () => {
|
||||||
source:
|
source:
|
||||||
'@site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
'@site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('translated fr doc with editUrl and editLocalizedFiles=true + editCurrentVersion=true', async () => {
|
test('translated fr doc with editUrl and editLocalizedFiles=true + editCurrentVersion=true', async () => {
|
||||||
const {siteDir, context, options, version100} = await loadSite({
|
const {siteDir, context, options, version100} = await loadSite({
|
||||||
options: {
|
options: {
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',
|
||||||
editCurrentVersion: true,
|
editCurrentVersion: true,
|
||||||
editLocalizedFiles: true,
|
editLocalizedFiles: true,
|
||||||
},
|
},
|
||||||
|
@ -872,7 +872,7 @@ describe('versioned site', () => {
|
||||||
source:
|
source:
|
||||||
'@site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
'@site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md',
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/fr/docusaurus-plugin-content-docs/current/hello.md',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/fr/docusaurus-plugin-content-docs/current/hello.md',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -412,7 +412,7 @@ describe('versioned site, pluginId=default', () => {
|
||||||
const versionsMetadata = readVersionsMetadata({
|
const versionsMetadata = readVersionsMetadata({
|
||||||
options: {
|
options: {
|
||||||
...defaultOptions,
|
...defaultOptions,
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
},
|
},
|
||||||
context: defaultContext,
|
context: defaultContext,
|
||||||
});
|
});
|
||||||
|
@ -421,30 +421,30 @@ describe('versioned site, pluginId=default', () => {
|
||||||
{
|
{
|
||||||
...vCurrent,
|
...vCurrent,
|
||||||
versionEditUrl:
|
versionEditUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/docs',
|
'https://github.com/facebook/docusaurus/edit/main/website/docs',
|
||||||
versionEditUrlLocalized:
|
versionEditUrlLocalized:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/en/docusaurus-plugin-content-docs/current',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/en/docusaurus-plugin-content-docs/current',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...v101,
|
...v101,
|
||||||
versionEditUrl:
|
versionEditUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/versioned_docs/version-1.0.1',
|
'https://github.com/facebook/docusaurus/edit/main/website/versioned_docs/version-1.0.1',
|
||||||
versionEditUrlLocalized:
|
versionEditUrlLocalized:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/en/docusaurus-plugin-content-docs/version-1.0.1',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/en/docusaurus-plugin-content-docs/version-1.0.1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...v100,
|
...v100,
|
||||||
versionEditUrl:
|
versionEditUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/versioned_docs/version-1.0.0',
|
'https://github.com/facebook/docusaurus/edit/main/website/versioned_docs/version-1.0.0',
|
||||||
versionEditUrlLocalized:
|
versionEditUrlLocalized:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/en/docusaurus-plugin-content-docs/version-1.0.0',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/en/docusaurus-plugin-content-docs/version-1.0.0',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...vwithSlugs,
|
...vwithSlugs,
|
||||||
versionEditUrl:
|
versionEditUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/versioned_docs/version-withSlugs',
|
'https://github.com/facebook/docusaurus/edit/main/website/versioned_docs/version-withSlugs',
|
||||||
versionEditUrlLocalized:
|
versionEditUrlLocalized:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/en/docusaurus-plugin-content-docs/version-withSlugs',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/en/docusaurus-plugin-content-docs/version-withSlugs',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
@ -462,7 +462,7 @@ describe('versioned site, pluginId=default', () => {
|
||||||
const versionsMetadata = readVersionsMetadata({
|
const versionsMetadata = readVersionsMetadata({
|
||||||
options: {
|
options: {
|
||||||
...defaultOptions,
|
...defaultOptions,
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
editCurrentVersion: true,
|
editCurrentVersion: true,
|
||||||
},
|
},
|
||||||
context: defaultContext,
|
context: defaultContext,
|
||||||
|
@ -472,30 +472,30 @@ describe('versioned site, pluginId=default', () => {
|
||||||
{
|
{
|
||||||
...vCurrent,
|
...vCurrent,
|
||||||
versionEditUrl:
|
versionEditUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/docs',
|
'https://github.com/facebook/docusaurus/edit/main/website/docs',
|
||||||
versionEditUrlLocalized:
|
versionEditUrlLocalized:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/en/docusaurus-plugin-content-docs/current',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/en/docusaurus-plugin-content-docs/current',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...v101,
|
...v101,
|
||||||
versionEditUrl:
|
versionEditUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/docs',
|
'https://github.com/facebook/docusaurus/edit/main/website/docs',
|
||||||
versionEditUrlLocalized:
|
versionEditUrlLocalized:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/en/docusaurus-plugin-content-docs/current',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/en/docusaurus-plugin-content-docs/current',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...v100,
|
...v100,
|
||||||
versionEditUrl:
|
versionEditUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/docs',
|
'https://github.com/facebook/docusaurus/edit/main/website/docs',
|
||||||
versionEditUrlLocalized:
|
versionEditUrlLocalized:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/en/docusaurus-plugin-content-docs/current',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/en/docusaurus-plugin-content-docs/current',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...vwithSlugs,
|
...vwithSlugs,
|
||||||
versionEditUrl:
|
versionEditUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/docs',
|
'https://github.com/facebook/docusaurus/edit/main/website/docs',
|
||||||
versionEditUrlLocalized:
|
versionEditUrlLocalized:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/i18n/en/docusaurus-plugin-content-docs/current',
|
'https://github.com/facebook/docusaurus/edit/main/website/i18n/en/docusaurus-plugin-content-docs/current',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,4 +28,4 @@ module.exports = {
|
||||||
$ npm swizzle @docusaurus/theme-bootstrap [component name]
|
$ npm swizzle @docusaurus/theme-bootstrap [component name]
|
||||||
```
|
```
|
||||||
|
|
||||||
All components used by this theme can be found [here](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-bootstrap/src/theme)
|
All components used by this theme can be found [here](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-bootstrap/src/theme)
|
||||||
|
|
|
@ -28,4 +28,4 @@ module.exports = {
|
||||||
$ npm swizzle @docusaurus/theme-classic [component name]
|
$ npm swizzle @docusaurus/theme-classic [component name]
|
||||||
```
|
```
|
||||||
|
|
||||||
All components used by this theme can be found [here](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-classic/src/theme)
|
All components used by this theme can be found [here](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/src/theme)
|
||||||
|
|
|
@ -103,10 +103,19 @@ This behavior can have SEO impacts and create relative link issues.
|
||||||
shell.exit(0);
|
shell.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// github.io indicates organization repos that deploy via master. All others use gh-pages.
|
// github.io indicates organization repos that deploy via default branch. All others use gh-pages.
|
||||||
const deploymentBranch =
|
// Organization deploys looks like:
|
||||||
process.env.DEPLOYMENT_BRANCH ||
|
// - Git repo: https://github.com/<organization>/<organization>.github.io
|
||||||
(projectName.indexOf('.github.io') !== -1 ? 'master' : 'gh-pages');
|
// - Site url: https://<organization>.github.io
|
||||||
|
const isGitHubPagesOrganizationDeploy =
|
||||||
|
projectName.indexOf('.github.io') !== -1;
|
||||||
|
if (isGitHubPagesOrganizationDeploy && !process.env.DEPLOYMENT_BRANCH) {
|
||||||
|
throw new Error(`For GitHub pages organization deployments, 'docusaurus deploy' does not assume anymore that 'master' is your default Git branch.
|
||||||
|
Please provide the branch name to deploy to as an environment variable.
|
||||||
|
Try using DEPLOYMENT_BRANCH=main or DEPLOYMENT_BRANCH=master`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const deploymentBranch = process.env.DEPLOYMENT_BRANCH || 'gh-pages';
|
||||||
console.log(`${chalk.cyan('deploymentBranch:')} ${deploymentBranch}`);
|
console.log(`${chalk.cyan('deploymentBranch:')} ${deploymentBranch}`);
|
||||||
|
|
||||||
const githubHost =
|
const githubHost =
|
||||||
|
@ -166,7 +175,7 @@ This behavior can have SEO impacts and create relative link issues.
|
||||||
|
|
||||||
// If the default branch is the one we're deploying to, then we'll fail
|
// If the default branch is the one we're deploying to, then we'll fail
|
||||||
// to create it. This is the case of a cross-repo publish, where we clone
|
// to create it. This is the case of a cross-repo publish, where we clone
|
||||||
// a github.io repo with a default master branch.
|
// a github.io repo with a default branch.
|
||||||
const defaultBranch = shell
|
const defaultBranch = shell
|
||||||
.exec('git rev-parse --abbrev-ref HEAD')
|
.exec('git rev-parse --abbrev-ref HEAD')
|
||||||
.stdout.trim();
|
.stdout.trim();
|
||||||
|
|
|
@ -38,7 +38,7 @@ function formatMessage(message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Strip webpack-added headers off errors/warnings
|
// Strip webpack-added headers off errors/warnings
|
||||||
// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
|
// https://github.com/webpack/webpack/blob/main/lib/ModuleError.js
|
||||||
lines = lines.filter((line) => !/Module [A-z ]+\(from/.test(line));
|
lines = lines.filter((line) => !/Module [A-z ]+\(from/.test(line));
|
||||||
|
|
||||||
// Transform parsing error into syntax error
|
// Transform parsing error into syntax error
|
||||||
|
|
|
@ -22,7 +22,7 @@ exports.dogfoodingPluginInstances = [
|
||||||
path: '_dogfooding/_blog tests',
|
path: '_dogfooding/_blog tests',
|
||||||
routeBasePath: '/tests/blog',
|
routeBasePath: '/tests/blog',
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/_dogfooding/_blog-tests',
|
'https://github.com/facebook/docusaurus/edit/main/website/_dogfooding/_blog-tests',
|
||||||
postsPerPage: 3,
|
postsPerPage: 3,
|
||||||
feedOptions: {
|
feedOptions: {
|
||||||
type: 'all',
|
type: 'all',
|
||||||
|
|
|
@ -18,7 +18,7 @@ In 2018, we proposed to rebuild [Docusaurus from the ground up](https://github.c
|
||||||
|
|
||||||
D2's killer features are **Dark Mode** and its **superb performance**. D2 has dark mode support out-of-the-box and it is near effortless to create a dark mode-friendly documentation site. Endilie put in great effort into optimizing the performance of the site and a bunch of performance optimization tricks have been done under the hood by default - optimized images, prerendering every route to static HTML and client-side routing thereafter, prefetching assets needed by future navigations whenever the user hovers over a navigation link, etc.
|
D2's killer features are **Dark Mode** and its **superb performance**. D2 has dark mode support out-of-the-box and it is near effortless to create a dark mode-friendly documentation site. Endilie put in great effort into optimizing the performance of the site and a bunch of performance optimization tricks have been done under the hood by default - optimized images, prerendering every route to static HTML and client-side routing thereafter, prefetching assets needed by future navigations whenever the user hovers over a navigation link, etc.
|
||||||
|
|
||||||
Last but not least, we implemented a plugins architecture and turned the repo into a [Lerna monorepo](https://github.com/facebook/docusaurus/tree/master/packages). We believe this plugin architecture will be helpful towards building a community and also allowing users to build their own features for their unique use cases.
|
Last but not least, we implemented a plugins architecture and turned the repo into a [Lerna monorepo](https://github.com/facebook/docusaurus/tree/main/packages). We believe this plugin architecture will be helpful towards building a community and also allowing users to build their own features for their unique use cases.
|
||||||
|
|
||||||
## GitHub Activity
|
## GitHub Activity
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ Yangshun gave a classroom session during F8 about [Using Docusaurus to Create Op
|
||||||
|
|
||||||
A few third-party hosting/development services also has first-class integration with a Docusaurus setup:
|
A few third-party hosting/development services also has first-class integration with a Docusaurus setup:
|
||||||
|
|
||||||
- [ZEIT Now deployment](https://github.com/zeit/now-examples/tree/master/docusaurus)
|
- [Vercel deployment](https://github.com/vercel/vercel/tree/main/examples/docusaurus)
|
||||||
- [CodeSandbox](https://codesandbox.io/s/docusaurus-template-x3vg9)
|
- [CodeSandbox](https://codesandbox.io/s/docusaurus-template-x3vg9)
|
||||||
- [Render](https://render.com/docs/deploy-docusaurus)
|
- [Render](https://render.com/docs/deploy-docusaurus)
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ The goals of the Docusaurus i18n system are:
|
||||||
- **Easy to use with [Crowdin](https://crowdin.com/)**: multiple Docusaurus 1 sites use Crowdin, and should be able to migrate to v2
|
- **Easy to use with [Crowdin](https://crowdin.com/)**: multiple Docusaurus 1 sites use Crowdin, and should be able to migrate to v2
|
||||||
- **Good SEO defaults**: we set useful SEO headers like [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) for you
|
- **Good SEO defaults**: we set useful SEO headers like [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) for you
|
||||||
- **RTL support**: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
|
- **RTL support**: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
|
||||||
- **Default translations**: classic theme labels are translated for you in [many languages](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-classic/codeTranslations)
|
- **Default translations**: classic theme labels are translated for you in [many languages](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/codeTranslations)
|
||||||
|
|
||||||
## Showcase
|
## Showcase
|
||||||
|
|
||||||
|
|
|
@ -140,14 +140,14 @@ Small pull requests are much easier to review and more likely to get merged. Mak
|
||||||
|
|
||||||
Please make sure the following is done when submitting a pull request:
|
Please make sure the following is done when submitting a pull request:
|
||||||
|
|
||||||
1. Fork [the repository](https://github.com/facebook/docusaurus) and create your branch from `master`.
|
1. Fork [the repository](https://github.com/facebook/docusaurus) and create your branch from `main`.
|
||||||
1. Add the copyright notice to the top of any code new files you've added.
|
1. Add the copyright notice to the top of any code new files you've added.
|
||||||
1. Describe your [test plan](#test-plan) in your pull request description. Make sure to [test your changes](https://github.com/facebook/docusaurus/blob/master/admin/testing-changes-on-Docusaurus-itself.md/)!
|
1. Describe your [test plan](#test-plan) in your pull request description. Make sure to [test your changes](https://github.com/facebook/docusaurus/blob/main/admin/testing-changes-on-Docusaurus-itself.md/)!
|
||||||
1. Make sure your code lints (`yarn prettier && yarn lint`).
|
1. Make sure your code lints (`yarn prettier && yarn lint`).
|
||||||
1. Make sure your Jest tests pass (`yarn test`).
|
1. Make sure your Jest tests pass (`yarn test`).
|
||||||
1. If you haven't already, [sign the CLA](https://code.facebook.com/cla).
|
1. If you haven't already, [sign the CLA](https://code.facebook.com/cla).
|
||||||
|
|
||||||
All pull requests should be opened against the `master` branch.
|
All pull requests should be opened against the `main` branch.
|
||||||
|
|
||||||
#### Test plan {#test-plan}
|
#### Test plan {#test-plan}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ A canary release passes all automated tests, and is used in production by the Do
|
||||||
|
|
||||||
## Canary npm dist tag
|
## Canary npm dist tag
|
||||||
|
|
||||||
For any code-related commit on `master`, the continuous integration will publish a canary release under the `@canary` npm dist tag. It generally takes up to 10 minutes.
|
For any code-related commit on `main`, the continuous integration will publish a canary release under the `@canary` npm dist tag. It generally takes up to 10 minutes.
|
||||||
|
|
||||||
You can see on [npm](https://www.npmjs.com/package/@docusaurus/core?activeTab=versions) the current dist tags:
|
You can see on [npm](https://www.npmjs.com/package/@docusaurus/core?activeTab=versions) the current dist tags:
|
||||||
|
|
||||||
|
|
|
@ -83,10 +83,10 @@ Most Docusaurus users configure this plugin through the [preset options](#ex-con
|
||||||
const config = {
|
const config = {
|
||||||
path: 'blog',
|
path: 'blog',
|
||||||
// Simple use-case: string editUrl
|
// Simple use-case: string editUrl
|
||||||
// editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
// editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
// Advanced use-case: functional editUrl
|
// Advanced use-case: functional editUrl
|
||||||
editUrl: ({locale, blogDirPath, blogPath, permalink}) => {
|
editUrl: ({locale, blogDirPath, blogPath, permalink}) => {
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`;
|
||||||
},
|
},
|
||||||
editLocalizedFiles: false,
|
editLocalizedFiles: false,
|
||||||
blogTitle: 'Blog title',
|
blogTitle: 'Blog title',
|
||||||
|
|
|
@ -109,10 +109,10 @@ Most Docusaurus users configure this plugin through the [preset options](#ex-con
|
||||||
const config = {
|
const config = {
|
||||||
path: 'docs',
|
path: 'docs',
|
||||||
// Simple use-case: string editUrl
|
// Simple use-case: string editUrl
|
||||||
// editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
// editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
// Advanced use-case: functional editUrl
|
// Advanced use-case: functional editUrl
|
||||||
editUrl: ({versionDocsDirPath, docPath}) =>
|
editUrl: ({versionDocsDirPath, docPath}) =>
|
||||||
`https://github.com/facebook/docusaurus/edit/master/website/${versionDocsDirPath}/${docPath}`,
|
`https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`,
|
||||||
editLocalizedFiles: false,
|
editLocalizedFiles: false,
|
||||||
editCurrentVersion: false,
|
editCurrentVersion: false,
|
||||||
routeBasePath: 'docs',
|
routeBasePath: 'docs',
|
||||||
|
@ -263,7 +263,7 @@ hide_table_of_contents: false
|
||||||
sidebar_label: Markdown
|
sidebar_label: Markdown
|
||||||
sidebar_position: 3
|
sidebar_position: 3
|
||||||
pagination_label: Markdown features
|
pagination_label: Markdown features
|
||||||
custom_edit_url: https://github.com/facebook/docusaurus/edit/master/docs/api-doc-markdown.md
|
custom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md
|
||||||
description: How do I find you when I cannot solve this problem
|
description: How do I find you when I cannot solve this problem
|
||||||
keywords:
|
keywords:
|
||||||
- docs
|
- docs
|
||||||
|
|
|
@ -127,8 +127,8 @@ Optional parameters, also set as environment variables:
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `USE_SSH` | Set to `true` to use SSH instead of the default HTTPS for the connection to the GitHub repo. |
|
| `USE_SSH` | Set to `true` to use SSH instead of the default HTTPS for the connection to the GitHub repo. |
|
||||||
| `DEPLOYMENT_BRANCH` | The branch that the website will be deployed to, defaults to `gh-pages` for normal repos and `master` for repository names ending in `github.io`. |
|
| `DEPLOYMENT_BRANCH` | The branch that the website will be deployed to, defaults to `gh-pages`. For GitHub Pages Organization repos (`config.projectName` ending in `github.io`), this env variable is required. |
|
||||||
| `CURRENT_BRANCH` | The branch that contains the latest docs changes that will be deployed. Usually, the branch will be `master`, but it could be any branch (default or otherwise) except for `gh-pages`. If nothing is set for this variable, then the current branch will be used. |
|
| `CURRENT_BRANCH` | The branch that contains the latest docs changes that will be deployed. Usually, the branch will be `main`, but it could be any branch (default or otherwise) except for `gh-pages`. If nothing is set for this variable, then the current branch will be used. |
|
||||||
| `GIT_PASS` | Password (or token) of the `git` user (specified by `GIT_USER`). For example, to facilitate non-interactive deployment (e.g. continuous deployment) |
|
| `GIT_PASS` | Password (or token) of the `git` user (specified by `GIT_USER`). For example, to facilitate non-interactive deployment (e.g. continuous deployment) |
|
||||||
|
|
||||||
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
||||||
|
@ -269,7 +269,7 @@ node_js:
|
||||||
- '10'
|
- '10'
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- main
|
||||||
cache:
|
cache:
|
||||||
yarn: true
|
yarn: true
|
||||||
script:
|
script:
|
||||||
|
@ -279,7 +279,7 @@ script:
|
||||||
- yarn && GIT_USER="${GH_NAME}" yarn deploy
|
- yarn && GIT_USER="${GH_NAME}" yarn deploy
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, whenever a new commit lands in `master`, Travis CI will run your suite of tests and if everything passes, your website will be deployed via the `yarn deploy` script.
|
Now, whenever a new commit lands in `main`, Travis CI will run your suite of tests and if everything passes, your website will be deployed via the `yarn deploy` script.
|
||||||
|
|
||||||
### Triggering deployment with Buddy {#triggering-deployment-with-buddy}
|
### Triggering deployment with Buddy {#triggering-deployment-with-buddy}
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ After creating this simple pipeline, each new commit pushed to the branch you se
|
||||||
|
|
||||||
```yaml title="azure-pipelines.yml"
|
```yaml title="azure-pipelines.yml"
|
||||||
trigger:
|
trigger:
|
||||||
- master
|
- main
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
@ -329,7 +329,7 @@ steps:
|
||||||
- script: |
|
- script: |
|
||||||
git config --global user.name "${GH_NAME}"
|
git config --global user.name "${GH_NAME}"
|
||||||
git config --global user.email "${GH_EMAIL}"
|
git config --global user.email "${GH_EMAIL}"
|
||||||
git checkout -b master
|
git checkout -b main
|
||||||
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
|
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
|
||||||
yarn && GIT_USER="${GH_NAME}" yarn deploy
|
yarn && GIT_USER="${GH_NAME}" yarn deploy
|
||||||
env:
|
env:
|
||||||
|
@ -394,7 +394,7 @@ While you set up the site, specify the build commands and directories as follows
|
||||||
|
|
||||||
If you did not configure these build options, you may still go to "Site settings" -> "Build and deploy" after your site is created.
|
If you did not configure these build options, you may still go to "Site settings" -> "Build and deploy" after your site is created.
|
||||||
|
|
||||||
Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to `master`.
|
Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to `main`.
|
||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ To better understand how versioning works and see if it suits your needs, you ca
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
website
|
website
|
||||||
├── sidebars.json # sidebar for master (next) version
|
├── sidebars.json # sidebar for the current docs version
|
||||||
├── docs # docs directory for master (next) version
|
├── docs # docs directory for the current docs version
|
||||||
│ ├── foo
|
│ ├── foo
|
||||||
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
|
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
|
||||||
│ └── hello.md # https://mysite.com/docs/next/hello
|
│ └── hello.md # https://mysite.com/docs/next/hello
|
||||||
|
@ -48,11 +48,19 @@ The table below explains how a versioned file maps to its version and the genera
|
||||||
| --------------------------------------- | -------------- | ----------------- |
|
| --------------------------------------- | -------------- | ----------------- |
|
||||||
| `versioned_docs/version-1.0.0/hello.md` | 1.0.0 | /docs/1.0.0/hello |
|
| `versioned_docs/version-1.0.0/hello.md` | 1.0.0 | /docs/1.0.0/hello |
|
||||||
| `versioned_docs/version-1.1.0/hello.md` | 1.1.0 (latest) | /docs/hello |
|
| `versioned_docs/version-1.1.0/hello.md` | 1.1.0 (latest) | /docs/hello |
|
||||||
| `docs/hello.md` | next | /docs/next/hello |
|
| `docs/hello.md` | current | /docs/next/hello |
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
|
||||||
|
The files in the `docs` directory belong to the `current` docs version.
|
||||||
|
|
||||||
|
By default, the `current` docs version is labelled as `Next` and hosted under `/docs/next/*`, but is entirely configurable to fit your project's release lifecycle.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
### Tagging a new version {#tagging-a-new-version}
|
### Tagging a new version {#tagging-a-new-version}
|
||||||
|
|
||||||
1. First, make sure your content in the `docs` directory is ready to be frozen as a version. A version always should be based from master.
|
1. First, make sure the current docs version (the `docs` directory) is ready to be frozen.
|
||||||
1. Enter a new version number.
|
1. Enter a new version number.
|
||||||
|
|
||||||
```bash npm2yarn
|
```bash npm2yarn
|
||||||
|
@ -72,7 +80,7 @@ When tagging a new version, the document versioning mechanism will:
|
||||||
1. Place the new file into the corresponding version folder.
|
1. Place the new file into the corresponding version folder.
|
||||||
1. Include the reference for the new file into the corresponding sidebar file, according to version number.
|
1. Include the reference for the new file into the corresponding sidebar file, according to version number.
|
||||||
|
|
||||||
**Master docs**
|
**Current version docs**
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# The new file.
|
# The new file.
|
||||||
|
@ -82,7 +90,7 @@ docs/new.md
|
||||||
sidebar.js
|
sidebar.js
|
||||||
```
|
```
|
||||||
|
|
||||||
**Older docs**
|
**Older version docs**
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# The new file.
|
# The new file.
|
||||||
|
|
|
@ -484,7 +484,7 @@ module.exports = {
|
||||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||||
}
|
}
|
||||||
// Link to Github for English docs
|
// Link to Github for English docs
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${versionDocsDirPath}/${docPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||||
},
|
},
|
||||||
// highlight-end
|
// highlight-end
|
||||||
},
|
},
|
||||||
|
@ -494,7 +494,7 @@ module.exports = {
|
||||||
if (locale !== DefaultLocale) {
|
if (locale !== DefaultLocale) {
|
||||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||||
}
|
}
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`;
|
||||||
},
|
},
|
||||||
// highlight-start
|
// highlight-start
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,7 +27,7 @@ The goals of the Docusaurus i18n system are:
|
||||||
- **Easy to use with [Crowdin](https://crowdin.com/)**: multiple Docusaurus v1 sites use Crowdin, and should be able to migrate to v2
|
- **Easy to use with [Crowdin](https://crowdin.com/)**: multiple Docusaurus v1 sites use Crowdin, and should be able to migrate to v2
|
||||||
- **Good SEO defaults**: we set useful SEO headers like [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) for you
|
- **Good SEO defaults**: we set useful SEO headers like [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) for you
|
||||||
- **RTL support**: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
|
- **RTL support**: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
|
||||||
- **Default translations**: classic theme labels are translated for you in [many languages](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-classic/codeTranslations)
|
- **Default translations**: classic theme labels are translated for you in [many languages](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/codeTranslations)
|
||||||
|
|
||||||
### i18n non-goals {#i18n-non-goals}
|
### i18n non-goals {#i18n-non-goals}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ This tutorial will walk you through the basis of the **Docusaurus i18n system**.
|
||||||
|
|
||||||
We will add **French** translations to a **newly initialized English Docusaurus website**.
|
We will add **French** translations to a **newly initialized English Docusaurus website**.
|
||||||
|
|
||||||
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/master/examples/classic)).
|
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
|
||||||
|
|
||||||
## Configure your site {#configure-your-site}
|
## Configure your site {#configure-your-site}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ We haven't provided any translation, and the site is **mostly untranslated**.
|
||||||
|
|
||||||
Docusaurus provides **default translations** for generic theme labels, such as "Next" and "Previous" for the pagination.
|
Docusaurus provides **default translations** for generic theme labels, such as "Next" and "Previous" for the pagination.
|
||||||
|
|
||||||
Please help us complete those **[default translations](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-classic/codeTranslations)**.
|
Please help us complete those **[default translations](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/codeTranslations)**.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ id: installation
|
||||||
title: Installation
|
title: Installation
|
||||||
---
|
---
|
||||||
|
|
||||||
Docusaurus is essentially a set of npm [packages](https://github.com/facebook/docusaurus/tree/master/packages).
|
Docusaurus is essentially a set of npm [packages](https://github.com/facebook/docusaurus/tree/main/packages).
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ yarn-error.log*
|
||||||
|
|
||||||
### `README` {#readme}
|
### `README` {#readme}
|
||||||
|
|
||||||
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-init/templates/classic/README.md).
|
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-init/templates/classic/README.md).
|
||||||
|
|
||||||
## Site configurations {#site-configurations}
|
## Site configurations {#site-configurations}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ module.exports = {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
We recommend moving the `docs` folder into the `website` folder and that is also the default directory structure in v2. [Now](https://zeit.co/now) supports [Docusaurus project deployments out-of-the-box](https://github.com/zeit/now-examples/tree/master/docusaurus) if the `docs` directory is within the `website`. It is also generally better for the docs to be within the website so that the docs and the rest of the website code are co-located within one `website` directory.
|
We recommend moving the `docs` folder into the `website` folder and that is also the default directory structure in v2. [Vercel](https://vercel.com) supports [Docusaurus project deployments out-of-the-box](https://github.com/vercel/vercel/tree/main/examples/docusaurus) if the `docs` directory is within the `website`. It is also generally better for the docs to be within the website so that the docs and the rest of the website code are co-located within one `website` directory.
|
||||||
|
|
||||||
If you are migrating your Docusaurus v1 website, and there are pending documentation pull requests, you can temporarily keep the `/docs` folder to its original place, to avoid producing conflicts.
|
If you are migrating your Docusaurus v1 website, and there are pending documentation pull requests, you can temporarily keep the `/docs` folder to its original place, to avoid producing conflicts.
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ module.exports = {
|
||||||
// Equivalent to `customDocsPath`.
|
// Equivalent to `customDocsPath`.
|
||||||
path: 'docs',
|
path: 'docs',
|
||||||
// Equivalent to `editUrl` but should point to `website` dir instead of `website/docs`.
|
// Equivalent to `editUrl` but should point to `website` dir instead of `website/docs`.
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',
|
||||||
// Equivalent to `docsUrl`.
|
// Equivalent to `docsUrl`.
|
||||||
routeBasePath: 'docs',
|
routeBasePath: 'docs',
|
||||||
// Remark and Rehype plugins passed to MDX. Replaces `markdownOptions` and `markdownPlugins`.
|
// Remark and Rehype plugins passed to MDX. Replaces `markdownOptions` and `markdownPlugins`.
|
||||||
|
@ -551,8 +551,8 @@ export default MyPage;
|
||||||
|
|
||||||
The following code could be helpful for migration of various pages:
|
The following code could be helpful for migration of various pages:
|
||||||
|
|
||||||
- Index page - [Flux](https://github.com/facebook/flux/blob/master/website/src/pages/index.js/) (recommended), [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/index.js/), [Hermes](https://github.com/facebook/hermes/blob/master/website/src/pages/index.js/)
|
- Index page - [Flux](https://github.com/facebook/flux/blob/master/website/src/pages/index.js/) (recommended), [Docusaurus 2](https://github.com/facebook/docusaurus/blob/main/website/src/pages/index.js/), [Hermes](https://github.com/facebook/hermes/blob/main/website/src/pages/index.js/)
|
||||||
- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support)
|
- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/main/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support)
|
||||||
|
|
||||||
## Content {#content}
|
## Content {#content}
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ This workflow has not been tested in practice, please report us how good it is.
|
||||||
|
|
||||||
This way, you wouldn't need to create a new Crowdin project, transfer the translation memory, apply pre-translations, and try to fix the pre-translations errors.
|
This way, you wouldn't need to create a new Crowdin project, transfer the translation memory, apply pre-translations, and try to fix the pre-translations errors.
|
||||||
|
|
||||||
You could create a Crowdin branch for Docusaurus v2, where you upload the v2 sources, and merge the Crowdin branch to master once ready.
|
You could create a Crowdin branch for Docusaurus v2, where you upload the v2 sources, and merge the Crowdin branch to main once ready.
|
||||||
|
|
||||||
### Use Git instead of Crowdin {#use-git-instead-of-crowdin}
|
### Use Git instead of Crowdin {#use-git-instead-of-crowdin}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,7 @@ module.exports = {
|
||||||
blog: {
|
blog: {
|
||||||
routeBasePath: '/',
|
routeBasePath: '/',
|
||||||
path: 'blog',
|
path: 'blog',
|
||||||
editUrl:
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/',
|
|
||||||
postsPerPage: 3,
|
postsPerPage: 3,
|
||||||
feedOptions: {
|
feedOptions: {
|
||||||
type: 'all',
|
type: 'all',
|
||||||
|
|
|
@ -112,7 +112,7 @@ const TwitterSvg =
|
||||||
if (locale !== 'en') {
|
if (locale !== 'en') {
|
||||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||||
}
|
}
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${versionDocsDirPath}/${docPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||||
},
|
},
|
||||||
editCurrentVersion: true,
|
editCurrentVersion: true,
|
||||||
sidebarPath: require.resolve('./sidebarsCommunity.js'),
|
sidebarPath: require.resolve('./sidebarsCommunity.js'),
|
||||||
|
@ -239,7 +239,7 @@ const TwitterSvg =
|
||||||
// We want users to submit doc updates to the upstream/next version!
|
// We want users to submit doc updates to the upstream/next version!
|
||||||
// Otherwise we risk losing the update on the next release.
|
// Otherwise we risk losing the update on the next release.
|
||||||
const nextVersionDocsDirPath = 'docs';
|
const nextVersionDocsDirPath = 'docs';
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${nextVersionDocsDirPath}/${docPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${nextVersionDocsDirPath}/${docPath}`;
|
||||||
},
|
},
|
||||||
showLastUpdateAuthor: true,
|
showLastUpdateAuthor: true,
|
||||||
showLastUpdateTime: true,
|
showLastUpdateTime: true,
|
||||||
|
@ -267,7 +267,7 @@ const TwitterSvg =
|
||||||
if (locale !== 'en') {
|
if (locale !== 'en') {
|
||||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||||
}
|
}
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`;
|
||||||
},
|
},
|
||||||
postsPerPage: 3,
|
postsPerPage: 3,
|
||||||
feedOptions: {
|
feedOptions: {
|
||||||
|
|
|
@ -979,7 +979,7 @@ const Users: User[] = [
|
||||||
description: 'The GraphQL client that scales with you',
|
description: 'The GraphQL client that scales with you',
|
||||||
preview: require('./showcase/relay.png'),
|
preview: require('./showcase/relay.png'),
|
||||||
website: 'https://relay.dev/',
|
website: 'https://relay.dev/',
|
||||||
source: 'https://github.com/facebook/relay/tree/master/website',
|
source: 'https://github.com/facebook/relay/tree/main/website',
|
||||||
tags: ['opensource','favorite','design','versioning'],
|
tags: ['opensource','favorite','design','versioning'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@ type Operator = 'OR' | 'AND';
|
||||||
const TITLE = 'Docusaurus Site Showcase';
|
const TITLE = 'Docusaurus Site Showcase';
|
||||||
const DESCRIPTION = 'List of websites people are building with Docusaurus';
|
const DESCRIPTION = 'List of websites people are building with Docusaurus';
|
||||||
const EDIT_URL =
|
const EDIT_URL =
|
||||||
'https://github.com/facebook/docusaurus/edit/master/website/src/data/users.tsx';
|
'https://github.com/facebook/docusaurus/edit/main/website/src/data/users.tsx';
|
||||||
|
|
||||||
function filterUsers(
|
function filterUsers(
|
||||||
users: User[],
|
users: User[],
|
||||||
|
|
|
@ -34,12 +34,12 @@ module.exports = {
|
||||||
* Base url to edit your site.
|
* Base url to edit your site.
|
||||||
* Docusaurus will compute the final editUrl with "editUrl + relativeDocPath"
|
* Docusaurus will compute the final editUrl with "editUrl + relativeDocPath"
|
||||||
*/
|
*/
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
/**
|
/**
|
||||||
* For advanced cases, compute the edit url for each Markdown file yourself.
|
* For advanced cases, compute the edit url for each Markdown file yourself.
|
||||||
*/
|
*/
|
||||||
editUrl: ({locale, blogDirPath, blogPath, permalink}) => {
|
editUrl: ({locale, blogDirPath, blogPath, permalink}) => {
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Useful if you commit localized files to git.
|
* Useful if you commit localized files to git.
|
||||||
|
|
|
@ -34,7 +34,7 @@ module.exports = {
|
||||||
* Base url to edit your site.
|
* Base url to edit your site.
|
||||||
* Docusaurus will compute the final editUrl with "editUrl + relativeDocPath"
|
* Docusaurus will compute the final editUrl with "editUrl + relativeDocPath"
|
||||||
*/
|
*/
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
/**
|
/**
|
||||||
* For advanced cases, compute the edit url for each Markdown file yourself.
|
* For advanced cases, compute the edit url for each Markdown file yourself.
|
||||||
*/
|
*/
|
||||||
|
@ -45,7 +45,7 @@ module.exports = {
|
||||||
docPath,
|
docPath,
|
||||||
permalink,
|
permalink,
|
||||||
}) {
|
}) {
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${versionDocsDirPath}/${docPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Useful if you commit localized files to git.
|
* Useful if you commit localized files to git.
|
||||||
|
@ -224,7 +224,7 @@ hide_table_of_contents: false
|
||||||
sidebar_label: Markdown
|
sidebar_label: Markdown
|
||||||
sidebar_position: 3
|
sidebar_position: 3
|
||||||
pagination_label: Markdown features
|
pagination_label: Markdown features
|
||||||
custom_edit_url: https://github.com/facebook/docusaurus/edit/master/docs/api-doc-markdown.md
|
custom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md
|
||||||
description: How do I find you when I cannot solve this problem
|
description: How do I find you when I cannot solve this problem
|
||||||
keywords:
|
keywords:
|
||||||
- docs
|
- docs
|
||||||
|
|
|
@ -127,8 +127,8 @@ Optional parameters, also set as environment variables:
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `USE_SSH` | Set to `true` to use SSH instead of the default HTTPS for the connection to the GitHub repo. |
|
| `USE_SSH` | Set to `true` to use SSH instead of the default HTTPS for the connection to the GitHub repo. |
|
||||||
| `DEPLOYMENT_BRANCH` | The branch that the website will be deployed to, defaults to `gh-pages` for normal repos and `master` for repository names ending in `github.io`. |
|
| `DEPLOYMENT_BRANCH` | The branch that the website will be deployed to, defaults to `gh-pages`. For GitHub Pages Organization repos (`config.projectName` ending in `github.io`), this env variable is required. |
|
||||||
| `CURRENT_BRANCH` | The branch that contains the latest docs changes that will be deployed. Usually, the branch will be `master`, but it could be any branch (default or otherwise) except for `gh-pages`. If nothing is set for this variable, then the current branch will be used. |
|
| `CURRENT_BRANCH` | The branch that contains the latest docs changes that will be deployed. Usually, the branch will be `main`, but it could be any branch (default or otherwise) except for `gh-pages`. If nothing is set for this variable, then the current branch will be used. |
|
||||||
| `GIT_PASS` | Password (or token) of the `git` user (specified by `GIT_USER`). For example, to facilitate non-interactive deployment (e.g. continuous deployment) |
|
| `GIT_PASS` | Password (or token) of the `git` user (specified by `GIT_USER`). For example, to facilitate non-interactive deployment (e.g. continuous deployment) |
|
||||||
|
|
||||||
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
||||||
|
@ -269,7 +269,7 @@ node_js:
|
||||||
- '10'
|
- '10'
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- main
|
||||||
cache:
|
cache:
|
||||||
yarn: true
|
yarn: true
|
||||||
script:
|
script:
|
||||||
|
@ -279,7 +279,7 @@ script:
|
||||||
- yarn && GIT_USER="${GH_NAME}" yarn deploy
|
- yarn && GIT_USER="${GH_NAME}" yarn deploy
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, whenever a new commit lands in `master`, Travis CI will run your suite of tests and if everything passes, your website will be deployed via the `yarn deploy` script.
|
Now, whenever a new commit lands in `main`, Travis CI will run your suite of tests and if everything passes, your website will be deployed via the `yarn deploy` script.
|
||||||
|
|
||||||
### Triggering deployment with Buddy {#triggering-deployment-with-buddy}
|
### Triggering deployment with Buddy {#triggering-deployment-with-buddy}
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ After creating this simple pipeline, each new commit pushed to the branch you se
|
||||||
|
|
||||||
```yaml title="azure-pipelines.yml"
|
```yaml title="azure-pipelines.yml"
|
||||||
trigger:
|
trigger:
|
||||||
- master
|
- main
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
@ -329,7 +329,7 @@ steps:
|
||||||
- script: |
|
- script: |
|
||||||
git config --global user.name "${GH_NAME}"
|
git config --global user.name "${GH_NAME}"
|
||||||
git config --global user.email "${GH_EMAIL}"
|
git config --global user.email "${GH_EMAIL}"
|
||||||
git checkout -b master
|
git checkout -b main
|
||||||
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
|
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
|
||||||
yarn && GIT_USER="${GH_NAME}" yarn deploy
|
yarn && GIT_USER="${GH_NAME}" yarn deploy
|
||||||
env:
|
env:
|
||||||
|
@ -394,7 +394,7 @@ While you set up the site, specify the build commands and directories as follows
|
||||||
|
|
||||||
If you did not configure these build options, you may still go to "Site settings" -> "Build and deploy" after your site is created.
|
If you did not configure these build options, you may still go to "Site settings" -> "Build and deploy" after your site is created.
|
||||||
|
|
||||||
Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to `master`.
|
Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to `main`.
|
||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ To better understand how versioning works and see if it suits your needs, you ca
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
website
|
website
|
||||||
├── sidebars.json # sidebar for master (next) version
|
├── sidebars.json # sidebar for the current docs version
|
||||||
├── docs # docs directory for master (next) version
|
├── docs # docs directory for the current docs version
|
||||||
│ ├── foo
|
│ ├── foo
|
||||||
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
|
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
|
||||||
│ └── hello.md # https://mysite.com/docs/next/hello
|
│ └── hello.md # https://mysite.com/docs/next/hello
|
||||||
|
@ -48,11 +48,19 @@ The table below explains how a versioned file maps to its version and the genera
|
||||||
| --------------------------------------- | -------------- | ----------------- |
|
| --------------------------------------- | -------------- | ----------------- |
|
||||||
| `versioned_docs/version-1.0.0/hello.md` | 1.0.0 | /docs/1.0.0/hello |
|
| `versioned_docs/version-1.0.0/hello.md` | 1.0.0 | /docs/1.0.0/hello |
|
||||||
| `versioned_docs/version-1.1.0/hello.md` | 1.1.0 (latest) | /docs/hello |
|
| `versioned_docs/version-1.1.0/hello.md` | 1.1.0 (latest) | /docs/hello |
|
||||||
| `docs/hello.md` | next | /docs/next/hello |
|
| `docs/hello.md` | current | /docs/next/hello |
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
|
||||||
|
The files in the `docs` directory belong to the `current` docs version.
|
||||||
|
|
||||||
|
By default, the `current` docs version is labelled as `Next` and hosted under `/docs/next/*`, but is entirely configurable to fit your project's release lifecycle.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
### Tagging a new version {#tagging-a-new-version}
|
### Tagging a new version {#tagging-a-new-version}
|
||||||
|
|
||||||
1. First, make sure your content in the `docs` directory is ready to be frozen as a version. A version always should be based from master.
|
1. First, make sure the current docs version (the `docs` directory) is ready to be frozen.
|
||||||
1. Enter a new version number.
|
1. Enter a new version number.
|
||||||
|
|
||||||
```bash npm2yarn
|
```bash npm2yarn
|
||||||
|
@ -72,7 +80,7 @@ When tagging a new version, the document versioning mechanism will:
|
||||||
1. Place the new file into the corresponding version folder.
|
1. Place the new file into the corresponding version folder.
|
||||||
1. Include the reference for the new file into the corresponding sidebar file, according to version number.
|
1. Include the reference for the new file into the corresponding sidebar file, according to version number.
|
||||||
|
|
||||||
**Master docs**
|
**Current version docs**
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# The new file.
|
# The new file.
|
||||||
|
@ -82,7 +90,7 @@ docs/new.md
|
||||||
sidebar.js
|
sidebar.js
|
||||||
```
|
```
|
||||||
|
|
||||||
**Older docs**
|
**Older version docs**
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# The new file.
|
# The new file.
|
||||||
|
|
|
@ -484,7 +484,7 @@ module.exports = {
|
||||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||||
}
|
}
|
||||||
// Link to Github for English docs
|
// Link to Github for English docs
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${versionDocsDirPath}/${docPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||||
},
|
},
|
||||||
// highlight-end
|
// highlight-end
|
||||||
},
|
},
|
||||||
|
@ -494,7 +494,7 @@ module.exports = {
|
||||||
if (locale !== DefaultLocale) {
|
if (locale !== DefaultLocale) {
|
||||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||||
}
|
}
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`;
|
||||||
},
|
},
|
||||||
// highlight-start
|
// highlight-start
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,7 +27,7 @@ The goals of the Docusaurus i18n system are:
|
||||||
- **Easy to use with [Crowdin](https://crowdin.com/)**: multiple Docusaurus v1 sites use Crowdin, and should be able to migrate to v2
|
- **Easy to use with [Crowdin](https://crowdin.com/)**: multiple Docusaurus v1 sites use Crowdin, and should be able to migrate to v2
|
||||||
- **Good SEO defaults**: we set useful SEO headers like [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) for you
|
- **Good SEO defaults**: we set useful SEO headers like [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) for you
|
||||||
- **RTL support**: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
|
- **RTL support**: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
|
||||||
- **Default translations**: classic theme labels are translated for you in [many languages](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-classic/codeTranslations)
|
- **Default translations**: classic theme labels are translated for you in [many languages](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/codeTranslations)
|
||||||
|
|
||||||
### i18n non-goals {#i18n-non-goals}
|
### i18n non-goals {#i18n-non-goals}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ This tutorial will walk you through the basis of the **Docusaurus i18n system**.
|
||||||
|
|
||||||
We will add **French** translations to a **newly initialized English Docusaurus website**.
|
We will add **French** translations to a **newly initialized English Docusaurus website**.
|
||||||
|
|
||||||
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/master/examples/classic)).
|
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
|
||||||
|
|
||||||
## Configure your site {#configure-your-site}
|
## Configure your site {#configure-your-site}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ We haven't provided any translation, and the site is **mostly untranslated**.
|
||||||
|
|
||||||
Docusaurus provides **default translations** for generic theme labels, such as "Next" and "Previous" for the pagination.
|
Docusaurus provides **default translations** for generic theme labels, such as "Next" and "Previous" for the pagination.
|
||||||
|
|
||||||
Please help us complete those **[default translations](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-classic/codeTranslations)**.
|
Please help us complete those **[default translations](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/codeTranslations)**.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ id: installation
|
||||||
title: Installation
|
title: Installation
|
||||||
---
|
---
|
||||||
|
|
||||||
Docusaurus is essentially a set of npm [packages](https://github.com/facebook/docusaurus/tree/master/packages).
|
Docusaurus is essentially a set of npm [packages](https://github.com/facebook/docusaurus/tree/main/packages).
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ yarn-error.log*
|
||||||
|
|
||||||
### `README` {#readme}
|
### `README` {#readme}
|
||||||
|
|
||||||
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-init/templates/classic/README.md).
|
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-init/templates/classic/README.md).
|
||||||
|
|
||||||
## Site configurations {#site-configurations}
|
## Site configurations {#site-configurations}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ module.exports = {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
We recommend moving the `docs` folder into the `website` folder and that is also the default directory structure in v2. [Now](https://zeit.co/now) supports [Docusaurus project deployments out-of-the-box](https://github.com/zeit/now-examples/tree/master/docusaurus) if the `docs` directory is within the `website`. It is also generally better for the docs to be within the website so that the docs and the rest of the website code are co-located within one `website` directory.
|
We recommend moving the `docs` folder into the `website` folder and that is also the default directory structure in v2. [Vercel](https://vercel.com) supports [Docusaurus project deployments out-of-the-box](https://github.com/vercel/vercel/tree/main/examples/docusaurus) if the `docs` directory is within the `website`. It is also generally better for the docs to be within the website so that the docs and the rest of the website code are co-located within one `website` directory.
|
||||||
|
|
||||||
If you are migrating your Docusaurus v1 website, and there are pending documentation pull requests, you can temporarily keep the `/docs` folder to its original place, to avoid producing conflicts.
|
If you are migrating your Docusaurus v1 website, and there are pending documentation pull requests, you can temporarily keep the `/docs` folder to its original place, to avoid producing conflicts.
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ module.exports = {
|
||||||
// Equivalent to `customDocsPath`.
|
// Equivalent to `customDocsPath`.
|
||||||
path: 'docs',
|
path: 'docs',
|
||||||
// Equivalent to `editUrl` but should point to `website` dir instead of `website/docs`.
|
// Equivalent to `editUrl` but should point to `website` dir instead of `website/docs`.
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',
|
||||||
// Equivalent to `docsUrl`.
|
// Equivalent to `docsUrl`.
|
||||||
routeBasePath: 'docs',
|
routeBasePath: 'docs',
|
||||||
// Remark and Rehype plugins passed to MDX. Replaces `markdownOptions` and `markdownPlugins`.
|
// Remark and Rehype plugins passed to MDX. Replaces `markdownOptions` and `markdownPlugins`.
|
||||||
|
@ -553,8 +553,8 @@ export default MyPage;
|
||||||
|
|
||||||
The following code could be helpful for migration of various pages:
|
The following code could be helpful for migration of various pages:
|
||||||
|
|
||||||
- Index page - [Flux](https://github.com/facebook/flux/blob/master/website/src/pages/index.js/) (recommended), [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/index.js/), [Hermes](https://github.com/facebook/hermes/blob/master/website/src/pages/index.js/)
|
- Index page - [Flux](https://github.com/facebook/flux/blob/master/website/src/pages/index.js/) (recommended), [Docusaurus 2](https://github.com/facebook/docusaurus/blob/main/website/src/pages/index.js/), [Hermes](https://github.com/facebook/hermes/blob/main/website/src/pages/index.js/)
|
||||||
- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support)
|
- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/main/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support)
|
||||||
|
|
||||||
## Content {#content}
|
## Content {#content}
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ This workflow has not been tested in practice, please report us how good it is.
|
||||||
|
|
||||||
This way, you wouldn't need to create a new Crowdin project, transfer the translation memory, apply pre-translations, and try to fix the pre-translations errors.
|
This way, you wouldn't need to create a new Crowdin project, transfer the translation memory, apply pre-translations, and try to fix the pre-translations errors.
|
||||||
|
|
||||||
You could create a Crowdin branch for Docusaurus v2, where you upload the v2 sources, and merge the Crowdin branch to master once ready.
|
You could create a Crowdin branch for Docusaurus v2, where you upload the v2 sources, and merge the Crowdin branch to main once ready.
|
||||||
|
|
||||||
### Use Git instead of Crowdin {#use-git-instead-of-crowdin}
|
### Use Git instead of Crowdin {#use-git-instead-of-crowdin}
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,12 @@ module.exports = {
|
||||||
* Base url to edit your site.
|
* Base url to edit your site.
|
||||||
* Docusaurus will compute the final editUrl with "editUrl + relativeDocPath"
|
* Docusaurus will compute the final editUrl with "editUrl + relativeDocPath"
|
||||||
*/
|
*/
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
/**
|
/**
|
||||||
* For advanced cases, compute the edit url for each Markdown file yourself.
|
* For advanced cases, compute the edit url for each Markdown file yourself.
|
||||||
*/
|
*/
|
||||||
editUrl: ({locale, blogDirPath, blogPath, permalink}) => {
|
editUrl: ({locale, blogDirPath, blogPath, permalink}) => {
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Useful if you commit localized files to git.
|
* Useful if you commit localized files to git.
|
||||||
|
|
|
@ -35,7 +35,7 @@ module.exports = {
|
||||||
* Docusaurus will compute the final editUrl with "editUrl + relativeDocPath"
|
* Docusaurus will compute the final editUrl with "editUrl + relativeDocPath"
|
||||||
* Omitting this variable entirely will disable edit links.
|
* Omitting this variable entirely will disable edit links.
|
||||||
*/
|
*/
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
||||||
/**
|
/**
|
||||||
* For advanced cases, compute the edit url for each Markdown file yourself.
|
* For advanced cases, compute the edit url for each Markdown file yourself.
|
||||||
*/
|
*/
|
||||||
|
@ -46,7 +46,7 @@ module.exports = {
|
||||||
docPath,
|
docPath,
|
||||||
permalink,
|
permalink,
|
||||||
}) {
|
}) {
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${versionDocsDirPath}/${docPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Useful if you commit localized files to git.
|
* Useful if you commit localized files to git.
|
||||||
|
@ -244,7 +244,7 @@ hide_table_of_contents: false
|
||||||
sidebar_label: Markdown
|
sidebar_label: Markdown
|
||||||
sidebar_position: 3
|
sidebar_position: 3
|
||||||
pagination_label: Markdown features
|
pagination_label: Markdown features
|
||||||
custom_edit_url: https://github.com/facebook/docusaurus/edit/master/docs/api-doc-markdown.md
|
custom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md
|
||||||
description: How do I find you when I cannot solve this problem
|
description: How do I find you when I cannot solve this problem
|
||||||
keywords:
|
keywords:
|
||||||
- docs
|
- docs
|
||||||
|
|
|
@ -127,8 +127,8 @@ Optional parameters, also set as environment variables:
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `USE_SSH` | Set to `true` to use SSH instead of the default HTTPS for the connection to the GitHub repo. |
|
| `USE_SSH` | Set to `true` to use SSH instead of the default HTTPS for the connection to the GitHub repo. |
|
||||||
| `DEPLOYMENT_BRANCH` | The branch that the website will be deployed to, defaults to `gh-pages` for normal repos and `master` for repository names ending in `github.io`. |
|
| `DEPLOYMENT_BRANCH` | The branch that the website will be deployed to, defaults to `gh-pages`. For GitHub Pages Organization repos (`config.projectName` ending in `github.io`), this env variable is required. |
|
||||||
| `CURRENT_BRANCH` | The branch that contains the latest docs changes that will be deployed. Usually, the branch will be `master`, but it could be any branch (default or otherwise) except for `gh-pages`. If nothing is set for this variable, then the current branch will be used. |
|
| `CURRENT_BRANCH` | The branch that contains the latest docs changes that will be deployed. Usually, the branch will be `main`, but it could be any branch (default or otherwise) except for `gh-pages`. If nothing is set for this variable, then the current branch will be used. |
|
||||||
| `GIT_PASS` | Password (or token) of the `git` user (specified by `GIT_USER`). For example, to facilitate non-interactive deployment (e.g. continuous deployment) |
|
| `GIT_PASS` | Password (or token) of the `git` user (specified by `GIT_USER`). For example, to facilitate non-interactive deployment (e.g. continuous deployment) |
|
||||||
|
|
||||||
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
||||||
|
@ -269,7 +269,7 @@ node_js:
|
||||||
- '10'
|
- '10'
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- main
|
||||||
cache:
|
cache:
|
||||||
yarn: true
|
yarn: true
|
||||||
script:
|
script:
|
||||||
|
@ -279,7 +279,7 @@ script:
|
||||||
- yarn && GIT_USER="${GH_NAME}" yarn deploy
|
- yarn && GIT_USER="${GH_NAME}" yarn deploy
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, whenever a new commit lands in `master`, Travis CI will run your suite of tests and if everything passes, your website will be deployed via the `yarn deploy` script.
|
Now, whenever a new commit lands in `main`, Travis CI will run your suite of tests and if everything passes, your website will be deployed via the `yarn deploy` script.
|
||||||
|
|
||||||
### Triggering deployment with Buddy {#triggering-deployment-with-buddy}
|
### Triggering deployment with Buddy {#triggering-deployment-with-buddy}
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ After creating this simple pipeline, each new commit pushed to the branch you se
|
||||||
|
|
||||||
```yaml title="azure-pipelines.yml"
|
```yaml title="azure-pipelines.yml"
|
||||||
trigger:
|
trigger:
|
||||||
- master
|
- main
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
@ -329,7 +329,7 @@ steps:
|
||||||
- script: |
|
- script: |
|
||||||
git config --global user.name "${GH_NAME}"
|
git config --global user.name "${GH_NAME}"
|
||||||
git config --global user.email "${GH_EMAIL}"
|
git config --global user.email "${GH_EMAIL}"
|
||||||
git checkout -b master
|
git checkout -b main
|
||||||
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
|
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
|
||||||
yarn && GIT_USER="${GH_NAME}" yarn deploy
|
yarn && GIT_USER="${GH_NAME}" yarn deploy
|
||||||
env:
|
env:
|
||||||
|
@ -394,7 +394,7 @@ While you set up the site, specify the build commands and directories as follows
|
||||||
|
|
||||||
If you did not configure these build options, you may still go to "Site settings" -> "Build and deploy" after your site is created.
|
If you did not configure these build options, you may still go to "Site settings" -> "Build and deploy" after your site is created.
|
||||||
|
|
||||||
Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to `master`.
|
Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to `main`.
|
||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ To better understand how versioning works and see if it suits your needs, you ca
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
website
|
website
|
||||||
├── sidebars.json # sidebar for master (next) version
|
├── sidebars.json # sidebar for the current docs version
|
||||||
├── docs # docs directory for master (next) version
|
├── docs # docs directory for the current docs version
|
||||||
│ ├── foo
|
│ ├── foo
|
||||||
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
|
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
|
||||||
│ └── hello.md # https://mysite.com/docs/next/hello
|
│ └── hello.md # https://mysite.com/docs/next/hello
|
||||||
|
@ -48,11 +48,19 @@ The table below explains how a versioned file maps to its version and the genera
|
||||||
| --------------------------------------- | -------------- | ----------------- |
|
| --------------------------------------- | -------------- | ----------------- |
|
||||||
| `versioned_docs/version-1.0.0/hello.md` | 1.0.0 | /docs/1.0.0/hello |
|
| `versioned_docs/version-1.0.0/hello.md` | 1.0.0 | /docs/1.0.0/hello |
|
||||||
| `versioned_docs/version-1.1.0/hello.md` | 1.1.0 (latest) | /docs/hello |
|
| `versioned_docs/version-1.1.0/hello.md` | 1.1.0 (latest) | /docs/hello |
|
||||||
| `docs/hello.md` | next | /docs/next/hello |
|
| `docs/hello.md` | current | /docs/next/hello |
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
|
||||||
|
The files in the `docs` directory belong to the `current` docs version.
|
||||||
|
|
||||||
|
By default, the `current` docs version is labelled as `Next` and hosted under `/docs/next/*`, but is entirely configurable to fit your project's release lifecycle.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
### Tagging a new version {#tagging-a-new-version}
|
### Tagging a new version {#tagging-a-new-version}
|
||||||
|
|
||||||
1. First, make sure your content in the `docs` directory is ready to be frozen as a version. A version always should be based from master.
|
1. First, make sure the current docs version (the `docs` directory) is ready to be frozen.
|
||||||
1. Enter a new version number.
|
1. Enter a new version number.
|
||||||
|
|
||||||
```bash npm2yarn
|
```bash npm2yarn
|
||||||
|
@ -72,7 +80,7 @@ When tagging a new version, the document versioning mechanism will:
|
||||||
1. Place the new file into the corresponding version folder.
|
1. Place the new file into the corresponding version folder.
|
||||||
1. Include the reference for the new file into the corresponding sidebar file, according to version number.
|
1. Include the reference for the new file into the corresponding sidebar file, according to version number.
|
||||||
|
|
||||||
**Master docs**
|
**Current version docs**
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# The new file.
|
# The new file.
|
||||||
|
@ -82,7 +90,7 @@ docs/new.md
|
||||||
sidebar.js
|
sidebar.js
|
||||||
```
|
```
|
||||||
|
|
||||||
**Older docs**
|
**Older version docs**
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# The new file.
|
# The new file.
|
||||||
|
|
|
@ -484,7 +484,7 @@ module.exports = {
|
||||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||||
}
|
}
|
||||||
// Link to Github for English docs
|
// Link to Github for English docs
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${versionDocsDirPath}/${docPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||||
},
|
},
|
||||||
// highlight-end
|
// highlight-end
|
||||||
},
|
},
|
||||||
|
@ -494,7 +494,7 @@ module.exports = {
|
||||||
if (locale !== DefaultLocale) {
|
if (locale !== DefaultLocale) {
|
||||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||||
}
|
}
|
||||||
return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`;
|
return `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`;
|
||||||
},
|
},
|
||||||
// highlight-start
|
// highlight-start
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,7 +27,7 @@ The goals of the Docusaurus i18n system are:
|
||||||
- **Easy to use with [Crowdin](https://crowdin.com/)**: multiple Docusaurus v1 sites use Crowdin, and should be able to migrate to v2
|
- **Easy to use with [Crowdin](https://crowdin.com/)**: multiple Docusaurus v1 sites use Crowdin, and should be able to migrate to v2
|
||||||
- **Good SEO defaults**: we set useful SEO headers like [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) for you
|
- **Good SEO defaults**: we set useful SEO headers like [`hreflang`](https://developers.google.com/search/docs/advanced/crawling/localized-versions) for you
|
||||||
- **RTL support**: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
|
- **RTL support**: locales reading right-to-left (Arabic, Hebrew, etc.) are supported and easy to implement
|
||||||
- **Default translations**: classic theme labels are translated for you in [many languages](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-classic/codeTranslations)
|
- **Default translations**: classic theme labels are translated for you in [many languages](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/codeTranslations)
|
||||||
|
|
||||||
### i18n non-goals {#i18n-non-goals}
|
### i18n non-goals {#i18n-non-goals}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ This tutorial will walk you through the basis of the **Docusaurus i18n system**.
|
||||||
|
|
||||||
We will add **French** translations to a **newly initialized English Docusaurus website**.
|
We will add **French** translations to a **newly initialized English Docusaurus website**.
|
||||||
|
|
||||||
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/master/examples/classic)).
|
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
|
||||||
|
|
||||||
## Configure your site {#configure-your-site}
|
## Configure your site {#configure-your-site}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ We haven't provided any translation, and the site is **mostly untranslated**.
|
||||||
|
|
||||||
Docusaurus provides **default translations** for generic theme labels, such as "Next" and "Previous" for the pagination.
|
Docusaurus provides **default translations** for generic theme labels, such as "Next" and "Previous" for the pagination.
|
||||||
|
|
||||||
Please help us complete those **[default translations](https://github.com/facebook/docusaurus/tree/master/packages/docusaurus-theme-classic/codeTranslations)**.
|
Please help us complete those **[default translations](https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/codeTranslations)**.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ id: installation
|
||||||
title: Installation
|
title: Installation
|
||||||
---
|
---
|
||||||
|
|
||||||
Docusaurus is essentially a set of npm [packages](https://github.com/facebook/docusaurus/tree/master/packages).
|
Docusaurus is essentially a set of npm [packages](https://github.com/facebook/docusaurus/tree/main/packages).
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ yarn-error.log*
|
||||||
|
|
||||||
### `README` {#readme}
|
### `README` {#readme}
|
||||||
|
|
||||||
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-init/templates/classic/README.md).
|
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-init/templates/classic/README.md).
|
||||||
|
|
||||||
## Site configurations {#site-configurations}
|
## Site configurations {#site-configurations}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ module.exports = {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
We recommend moving the `docs` folder into the `website` folder and that is also the default directory structure in v2. [Now](https://zeit.co/now) supports [Docusaurus project deployments out-of-the-box](https://github.com/zeit/now-examples/tree/master/docusaurus) if the `docs` directory is within the `website`. It is also generally better for the docs to be within the website so that the docs and the rest of the website code are co-located within one `website` directory.
|
We recommend moving the `docs` folder into the `website` folder and that is also the default directory structure in v2. [Vercel](https://vercel.com) supports [Docusaurus project deployments out-of-the-box](https://github.com/vercel/vercel/tree/main/examples/docusaurus) if the `docs` directory is within the `website`. It is also generally better for the docs to be within the website so that the docs and the rest of the website code are co-located within one `website` directory.
|
||||||
|
|
||||||
If you are migrating your Docusaurus v1 website, and there are pending documentation pull requests, you can temporarily keep the `/docs` folder to its original place, to avoid producing conflicts.
|
If you are migrating your Docusaurus v1 website, and there are pending documentation pull requests, you can temporarily keep the `/docs` folder to its original place, to avoid producing conflicts.
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ module.exports = {
|
||||||
// Equivalent to `customDocsPath`.
|
// Equivalent to `customDocsPath`.
|
||||||
path: 'docs',
|
path: 'docs',
|
||||||
// Equivalent to `editUrl` but should point to `website` dir instead of `website/docs`.
|
// Equivalent to `editUrl` but should point to `website` dir instead of `website/docs`.
|
||||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website',
|
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',
|
||||||
// Equivalent to `docsUrl`.
|
// Equivalent to `docsUrl`.
|
||||||
routeBasePath: 'docs',
|
routeBasePath: 'docs',
|
||||||
// Remark and Rehype plugins passed to MDX. Replaces `markdownOptions` and `markdownPlugins`.
|
// Remark and Rehype plugins passed to MDX. Replaces `markdownOptions` and `markdownPlugins`.
|
||||||
|
@ -551,8 +551,8 @@ export default MyPage;
|
||||||
|
|
||||||
The following code could be helpful for migration of various pages:
|
The following code could be helpful for migration of various pages:
|
||||||
|
|
||||||
- Index page - [Flux](https://github.com/facebook/flux/blob/master/website/src/pages/index.js/) (recommended), [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/index.js/), [Hermes](https://github.com/facebook/hermes/blob/master/website/src/pages/index.js/)
|
- Index page - [Flux](https://github.com/facebook/flux/blob/master/website/src/pages/index.js/) (recommended), [Docusaurus 2](https://github.com/facebook/docusaurus/blob/main/website/src/pages/index.js/), [Hermes](https://github.com/facebook/hermes/blob/main/website/src/pages/index.js/)
|
||||||
- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support)
|
- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/main/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support)
|
||||||
|
|
||||||
## Content {#content}
|
## Content {#content}
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ This workflow has not been tested in practice, please report us how good it is.
|
||||||
|
|
||||||
This way, you wouldn't need to create a new Crowdin project, transfer the translation memory, apply pre-translations, and try to fix the pre-translations errors.
|
This way, you wouldn't need to create a new Crowdin project, transfer the translation memory, apply pre-translations, and try to fix the pre-translations errors.
|
||||||
|
|
||||||
You could create a Crowdin branch for Docusaurus v2, where you upload the v2 sources, and merge the Crowdin branch to master once ready.
|
You could create a Crowdin branch for Docusaurus v2, where you upload the v2 sources, and merge the Crowdin branch to main once ready.
|
||||||
|
|
||||||
### Use Git instead of Crowdin {#use-git-instead-of-crowdin}
|
### Use Git instead of Crowdin {#use-git-instead-of-crowdin}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ const {Translations} = require('@crowdin/crowdin-api-client');
|
||||||
Crowdin does not support concurrent "project builds" (downloads of translations).
|
Crowdin does not support concurrent "project builds" (downloads of translations).
|
||||||
The Crowdin CLI fails with error 409, and it leads to failures on Netlify.
|
The Crowdin CLI fails with error 409, and it leads to failures on Netlify.
|
||||||
|
|
||||||
On Docusaurus, when we commit on master, we have 2 Netlify deployments triggered:
|
On Docusaurus, when we commit on main, we have 2 Netlify deployments triggered:
|
||||||
- prod
|
- prod
|
||||||
- i18n-staging (work-in-progress locales)
|
- i18n-staging (work-in-progress locales)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue