diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 8540cb7baf..12b4351a31 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -39,7 +39,7 @@ This way we know you've done these steps first. (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.) diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md index bc46857041..a85e5f5887 100644 --- a/.github/ISSUE_TEMPLATE/feature.md +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -15,7 +15,7 @@ labels: 'feature, needs triage' (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.) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8a4ba54d4a..a742b0973f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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. -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! @@ -13,7 +13,7 @@ Happy contributing! (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.) diff --git a/.github/workflows/canary-release.yml b/.github/workflows/canary-release.yml index a5ed9b0b63..8827e80f2d 100644 --- a/.github/workflows/canary-release.yml +++ b/.github/workflows/canary-release.yml @@ -3,7 +3,7 @@ name: Canary Release on: push: branches: - - master + - main paths: - 'packages/**' @@ -26,7 +26,7 @@ jobs: git config --global user.name "Docusaurus Canary" git config --global user.email "canary@docusaurus.io" git fetch - git checkout master + git checkout main echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc cat .npmrc echo "npm whoami" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a6411b5a26..d5acf35b3e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ name: Lint on: pull_request: branches: - - master + - main jobs: lint: @@ -15,8 +15,8 @@ jobs: - name: Installation uses: bahmutov/npm-install@v1 with: - install-command: yarn install - # install-command: yarn install --immutable # Fails if yarn.lock is modified (unfortunately only works for Yarn 2, and --frozen-lockfile is not the same!) + install-command: yarn install + # install-command: yarn install --immutable # Fails if yarn.lock is modified (unfortunately only works for Yarn 2, and --frozen-lockfile is not the same!) - name: Check immutable yarn.lock run: git diff --exit-code - name: Lint diff --git a/.github/workflows/v2-build-blog-only.yml b/.github/workflows/v2-build-blog-only.yml index 9ba3644979..e11b9bf9f9 100644 --- a/.github/workflows/v2-build-blog-only.yml +++ b/.github/workflows/v2-build-blog-only.yml @@ -3,7 +3,7 @@ name: V2 Build Blog-only on: pull_request: branches: - - master + - main paths: - 'website-1.x/blog/**' - 'packages/docusaurus/**' diff --git a/.github/workflows/v2-build-size-report.yml b/.github/workflows/v2-build-size-report.yml index 47ad4c68f5..73b43004d8 100644 --- a/.github/workflows/v2-build-size-report.yml +++ b/.github/workflows/v2-build-size-report.yml @@ -1,4 +1,3 @@ - name: V2 Build Size Report on: @@ -9,7 +8,7 @@ on: # See https://securitylab.github.com/research/github-actions-preventing-pwn-requests pull_request: branches: - - master + - main paths-ignore: - 'website-1.x/**' - 'packages/docusaurus-1.x/**' diff --git a/.github/workflows/v2-build-time-perf.yml b/.github/workflows/v2-build-time-perf.yml index e5b36e3b0f..b10bbbea74 100644 --- a/.github/workflows/v2-build-time-perf.yml +++ b/.github/workflows/v2-build-time-perf.yml @@ -3,7 +3,7 @@ name: V2 Build Time Perf on: pull_request: branches: - - master + - main paths-ignore: - 'website/docs/**' - 'website-1.x/**' @@ -31,5 +31,4 @@ jobs: - name: Build (warm cache) run: yarn workspace docusaurus-2-website build --locale en timeout-minutes: 2 - # TODO post a Github comment with build with perf warnings? diff --git a/.github/workflows/v2-lighthouse-report.yml b/.github/workflows/v2-lighthouse-report.yml index e425d4d9de..dc03732340 100644 --- a/.github/workflows/v2-lighthouse-report.yml +++ b/.github/workflows/v2-lighthouse-report.yml @@ -3,7 +3,7 @@ name: V2 Lighthouse Report on: pull_request_target: branches: - - master + - main paths-ignore: - 'website-1.x/**' - 'packages/docusaurus-1.x/**' @@ -25,7 +25,7 @@ jobs: uses: treosh/lighthouse-ci-action@v3 with: urls: | - https://deploy-preview-$PR_NUMBER--docusaurus-2.netlify.app/ + https://deploy-preview-$PR_NUMBER--docusaurus-2.netlify.app/ configPath: ./.github/workflows/v2-lighthousesrc.json uploadArtifacts: true temporaryPublicStorage: true diff --git a/.github/workflows/v2-tests-e2e.yml b/.github/workflows/v2-tests-e2e.yml index a95a9d01b1..5e0c9e0ca6 100644 --- a/.github/workflows/v2-tests-e2e.yml +++ b/.github/workflows/v2-tests-e2e.yml @@ -3,10 +3,10 @@ name: V2 Tests E2E on: push: branches: - - master + - main pull_request: branches: - - master + - main paths-ignore: - 'website-1.x/**' - 'packages/docusaurus-1.x/**' @@ -29,7 +29,7 @@ jobs: uses: bahmutov/npm-install@v1 with: install-command: yarn - - name: Generate test-website project against master release + - name: Generate test-website project against main branch run: | KEEP_CONTAINER=true yarn test:build:v2 -s mv test-website ../test-website @@ -66,7 +66,7 @@ jobs: with: install-command: yarn - - name: Generate test-website project against master release + - name: Generate test-website project against main branch run: | KEEP_CONTAINER=true yarn test:build:v2 -s mv test-website ../test-website diff --git a/.github/workflows/v2-tests-windows.yml b/.github/workflows/v2-tests-windows.yml index 1754b5e8ce..a393eeac2a 100644 --- a/.github/workflows/v2-tests-windows.yml +++ b/.github/workflows/v2-tests-windows.yml @@ -3,7 +3,7 @@ name: V2 Windows Tests on: pull_request: branches: - - master + - main paths-ignore: - 'website-1.x/**' - 'packages/docusaurus-1.x/**' diff --git a/.github/workflows/v2-tests.yml b/.github/workflows/v2-tests.yml index 2928c48ebf..8353d64fa0 100644 --- a/.github/workflows/v2-tests.yml +++ b/.github/workflows/v2-tests.yml @@ -3,7 +3,7 @@ name: V2 Tests on: pull_request: branches: - - master + - main paths-ignore: - 'website-1.x/**' - 'packages/docusaurus-1.x/**' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed60839fda..8770a1477b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,7 +57,7 @@ When a change made on GitHub is approved, it will be checked by our continuous i ### 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 @@ -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. -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 @@ -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: -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. 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 Jest tests pass (`yarn test`). 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 diff --git a/README.md b/README.md index b78c014338..c04beb3366 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Facebook has adopted a Code of Conduct that we expect project participants to ad ### 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 diff --git a/admin/local-third-party-project-testing.md b/admin/local-third-party-project-testing.md index 67b59145ca..ae4c0e6fdc 100644 --- a/admin/local-third-party-project-testing.md +++ b/admin/local-third-party-project-testing.md @@ -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) diff --git a/admin/new.docusaurus.io/functionUtils/playgroundUtils.ts b/admin/new.docusaurus.io/functionUtils/playgroundUtils.ts index d1a3626a5e..c34f948bed 100644 --- a/admin/new.docusaurus.io/functionUtils/playgroundUtils.ts +++ b/admin/new.docusaurus.io/functionUtils/playgroundUtils.ts @@ -13,7 +13,7 @@ const PlaygroundConfigs = { codesandbox: 'https://codesandbox.io/s/docusaurus', // 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 }; diff --git a/admin/publish.md b/admin/publish.md index 460f318cc0..93cbb99428 100644 --- a/admin/publish.md +++ b/admin/publish.md @@ -30,13 +30,13 @@ If you're publishing new v2 versions, 2FA might get in the way as the pin might ### 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 `/` pattern. ```sh -# up to date master -git co master +# up to date main +git co main git pull # create a new release branch diff --git a/examples/README.md b/examples/README.md index f06fdc38b3..260f52aec9 100644 --- a/examples/README.md +++ b/examples/README.md @@ -8,9 +8,9 @@ npx @docusaurus/init@latest init examples/ ` You can run them in CodeSandbox: -- [classic](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/classic) -- [bootstrap](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/bootstrap) -- [facebook](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/facebook) +- [classic](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/classic) +- [bootstrap](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/bootstrap) +- [facebook](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/facebook) **Tip**: use the [new.docusaurus.io](https://new.docusaurus.io) shortcut. diff --git a/examples/bootstrap/docusaurus.config.js b/examples/bootstrap/docusaurus.config.js index caf206df75..72df776a07 100644 --- a/examples/bootstrap/docusaurus.config.js +++ b/examples/bootstrap/docusaurus.config.js @@ -74,14 +74,13 @@ module.exports = { { docs: { sidebarPath: require.resolve('./sidebars.js'), - editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', }, blog: { showReadingTime: true, // Please change this to your repo. editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/blog/', + 'https://github.com/facebook/docusaurus/edit/main/website/blog/', }, }, ], diff --git a/examples/classic/docusaurus.config.js b/examples/classic/docusaurus.config.js index 0535857538..70b426dd4c 100644 --- a/examples/classic/docusaurus.config.js +++ b/examples/classic/docusaurus.config.js @@ -91,14 +91,13 @@ module.exports = { docs: { sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. - editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', }, blog: { showReadingTime: true, // Please change this to your repo. editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/blog/', + 'https://github.com/facebook/docusaurus/edit/main/website/blog/', }, theme: { customCss: require.resolve('./src/css/custom.css'), diff --git a/examples/facebook/docusaurus.config.js b/examples/facebook/docusaurus.config.js index de6256f1eb..5c6c93b3b9 100644 --- a/examples/facebook/docusaurus.config.js +++ b/examples/facebook/docusaurus.config.js @@ -126,14 +126,13 @@ module.exports = { docs: { sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. - editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', }, blog: { showReadingTime: true, // Please change this to your repo. editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/blog/', + 'https://github.com/facebook/docusaurus/edit/main/website/blog/', }, theme: { customCss: require.resolve('./src/css/custom.css'), diff --git a/generateExamples.js b/generateExamples.js index 970f31a527..4b571857e1 100644 --- a/generateExamples.js +++ b/generateExamples.js @@ -125,9 +125,9 @@ function updateStarters() { function run() { const branch = execSync('git rev-parse --abbrev-ref HEAD').toString(); - if (branch === 'master') { + if (branch === 'main') { 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 { diff --git a/packages/docusaurus-init/templates/bootstrap/docusaurus.config.js b/packages/docusaurus-init/templates/bootstrap/docusaurus.config.js index c61a0e3ca8..68c8f1ff6b 100644 --- a/packages/docusaurus-init/templates/bootstrap/docusaurus.config.js +++ b/packages/docusaurus-init/templates/bootstrap/docusaurus.config.js @@ -74,14 +74,13 @@ module.exports = { { docs: { sidebarPath: require.resolve('./sidebars.js'), - editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', }, blog: { showReadingTime: true, // Please change this to your repo. editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/blog/', + 'https://github.com/facebook/docusaurus/edit/main/website/blog/', }, }, ], diff --git a/packages/docusaurus-init/templates/classic/docusaurus.config.js b/packages/docusaurus-init/templates/classic/docusaurus.config.js index 0535857538..70b426dd4c 100644 --- a/packages/docusaurus-init/templates/classic/docusaurus.config.js +++ b/packages/docusaurus-init/templates/classic/docusaurus.config.js @@ -91,14 +91,13 @@ module.exports = { docs: { sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. - editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', }, blog: { showReadingTime: true, // Please change this to your repo. editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/blog/', + 'https://github.com/facebook/docusaurus/edit/main/website/blog/', }, theme: { customCss: require.resolve('./src/css/custom.css'), diff --git a/packages/docusaurus-init/templates/facebook/docusaurus.config.js b/packages/docusaurus-init/templates/facebook/docusaurus.config.js index 45922ae1cb..0645356283 100644 --- a/packages/docusaurus-init/templates/facebook/docusaurus.config.js +++ b/packages/docusaurus-init/templates/facebook/docusaurus.config.js @@ -126,14 +126,13 @@ module.exports = { docs: { sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. - editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', }, blog: { showReadingTime: true, // Please change this to your repo. editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/blog/', + 'https://github.com/facebook/docusaurus/edit/main/website/blog/', }, theme: { customCss: require.resolve('./src/css/custom.css'), diff --git a/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/siteConfig.js b/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/siteConfig.js index a15fb6aa78..70aef0a785 100644 --- a/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/siteConfig.js +++ b/packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/siteConfig.js @@ -24,7 +24,7 @@ const siteConfig = { cname: 'docusaurus.io', noIndex: false, users, - editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/', headerLinks: [ {doc: 'installation', label: 'Docs'}, {doc: 'tutorial-setup', label: 'Tutorial'}, diff --git a/packages/docusaurus-migrate/src/__tests__/__fixtures__/expectedSiteConfig.js b/packages/docusaurus-migrate/src/__tests__/__fixtures__/expectedSiteConfig.js index 8bb7d4108e..0b2da419c9 100644 --- a/packages/docusaurus-migrate/src/__tests__/__fixtures__/expectedSiteConfig.js +++ b/packages/docusaurus-migrate/src/__tests__/__fixtures__/expectedSiteConfig.js @@ -40,7 +40,7 @@ module.exports = { homePageId: 'installation', showLastUpdateAuthor: true, showLastUpdateTime: true, - editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/', }, blog: {}, theme: {}, diff --git a/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/siteConfig.js b/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/siteConfig.js index a15fb6aa78..70aef0a785 100644 --- a/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/siteConfig.js +++ b/packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/siteConfig.js @@ -24,7 +24,7 @@ const siteConfig = { cname: 'docusaurus.io', noIndex: false, users, - editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/', headerLinks: [ {doc: 'installation', label: 'Docs'}, {doc: 'tutorial-setup', label: 'Tutorial'}, diff --git a/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/siteConfig.js b/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/siteConfig.js index a15fb6aa78..70aef0a785 100644 --- a/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/siteConfig.js +++ b/packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/siteConfig.js @@ -24,7 +24,7 @@ const siteConfig = { cname: 'docusaurus.io', noIndex: false, users, - editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/', headerLinks: [ {doc: 'installation', label: 'Docs'}, {doc: 'tutorial-setup', label: 'Tutorial'}, diff --git a/packages/docusaurus-migrate/src/__tests__/__fixtures__/sourceSiteConfig.js b/packages/docusaurus-migrate/src/__tests__/__fixtures__/sourceSiteConfig.js index c379059c73..18de46fbf2 100644 --- a/packages/docusaurus-migrate/src/__tests__/__fixtures__/sourceSiteConfig.js +++ b/packages/docusaurus-migrate/src/__tests__/__fixtures__/sourceSiteConfig.js @@ -23,7 +23,7 @@ const siteConfig = { cname: 'docusaurus.io', noIndex: true, users, - editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/', headerLinks: [ {doc: 'installation', label: 'Docs'}, {doc: 'tutorial-setup', label: 'Tutorial'}, diff --git a/packages/docusaurus-migrate/src/index.ts b/packages/docusaurus-migrate/src/index.ts index c3064d9b2e..983b551c92 100644 --- a/packages/docusaurus-migrate/src/index.ts +++ b/packages/docusaurus-migrate/src/index.ts @@ -671,7 +671,7 @@ function migrateVersionedSidebar( to: `docs/${version}/`, })), { - label: 'Master/Unreleased', + label: 'Main/Unreleased', to: `docs/next/`, activeBaseRegex: `docs/next/(?!support|team|resources)`, }, diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts b/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts index c8c9f53413..8380a931b1 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts @@ -269,7 +269,7 @@ describe('simple site', () => { test('docs with editUrl', async () => { const {siteDir, context, options, currentVersion} = await loadSite({ 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', title: 'baz', 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', frontMatter: { id: 'baz', @@ -744,7 +744,7 @@ describe('versioned site', () => { test('translated doc with editUrl', async () => { const {siteDir, context, options, version100} = await loadSite({ options: { - editUrl: 'https://github.com/facebook/docusaurus/edit/master/website', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website', // editCurrentVersion: true, }, }); @@ -770,14 +770,14 @@ describe('versioned site', () => { source: '@site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md', 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 () => { const {siteDir, context, options, version100} = await loadSite({ options: { - editUrl: 'https://github.com/facebook/docusaurus/edit/master/website', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website', editCurrentVersion: true, }, }); @@ -803,14 +803,14 @@ describe('versioned site', () => { source: '@site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md', 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 () => { const {siteDir, context, options, version100} = await loadSite({ options: { - editUrl: 'https://github.com/facebook/docusaurus/edit/master/website', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website', editLocalizedFiles: true, }, locale: 'fr', @@ -837,14 +837,14 @@ describe('versioned site', () => { source: '@site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md', 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 () => { const {siteDir, context, options, version100} = await loadSite({ options: { - editUrl: 'https://github.com/facebook/docusaurus/edit/master/website', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website', editCurrentVersion: true, editLocalizedFiles: true, }, @@ -872,7 +872,7 @@ describe('versioned site', () => { source: '@site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md', 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', }); }); }); diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/versions.test.ts b/packages/docusaurus-plugin-content-docs/src/__tests__/versions.test.ts index 4c1ea7a661..43e27bdc21 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/versions.test.ts +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/versions.test.ts @@ -412,7 +412,7 @@ describe('versioned site, pluginId=default', () => { const versionsMetadata = readVersionsMetadata({ options: { ...defaultOptions, - editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', }, context: defaultContext, }); @@ -421,30 +421,30 @@ describe('versioned site, pluginId=default', () => { { ...vCurrent, versionEditUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/docs', + 'https://github.com/facebook/docusaurus/edit/main/website/docs', 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, 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: - '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, 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: - '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, 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: - '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({ options: { ...defaultOptions, - editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', editCurrentVersion: true, }, context: defaultContext, @@ -472,30 +472,30 @@ describe('versioned site, pluginId=default', () => { { ...vCurrent, versionEditUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/docs', + 'https://github.com/facebook/docusaurus/edit/main/website/docs', 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, versionEditUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/docs', + 'https://github.com/facebook/docusaurus/edit/main/website/docs', 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, versionEditUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/docs', + 'https://github.com/facebook/docusaurus/edit/main/website/docs', 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, versionEditUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/docs', + 'https://github.com/facebook/docusaurus/edit/main/website/docs', 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', }, ]); }); diff --git a/packages/docusaurus-theme-bootstrap/README.md b/packages/docusaurus-theme-bootstrap/README.md index 3687e9e0dc..eab5df37c7 100644 --- a/packages/docusaurus-theme-bootstrap/README.md +++ b/packages/docusaurus-theme-bootstrap/README.md @@ -28,4 +28,4 @@ module.exports = { $ 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) diff --git a/packages/docusaurus-theme-classic/README.md b/packages/docusaurus-theme-classic/README.md index dbce35b5f0..1bcc1807f4 100644 --- a/packages/docusaurus-theme-classic/README.md +++ b/packages/docusaurus-theme-classic/README.md @@ -28,4 +28,4 @@ module.exports = { $ 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) diff --git a/packages/docusaurus/src/commands/deploy.ts b/packages/docusaurus/src/commands/deploy.ts index 472524c319..7beaa7a055 100644 --- a/packages/docusaurus/src/commands/deploy.ts +++ b/packages/docusaurus/src/commands/deploy.ts @@ -103,10 +103,19 @@ This behavior can have SEO impacts and create relative link issues. shell.exit(0); } - // github.io indicates organization repos that deploy via master. All others use gh-pages. - const deploymentBranch = - process.env.DEPLOYMENT_BRANCH || - (projectName.indexOf('.github.io') !== -1 ? 'master' : 'gh-pages'); + // github.io indicates organization repos that deploy via default branch. All others use gh-pages. + // Organization deploys looks like: + // - Git repo: https://github.com//.github.io + // - Site url: https://.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}`); 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 // 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 .exec('git rev-parse --abbrev-ref HEAD') .stdout.trim(); diff --git a/packages/docusaurus/src/webpack/react-dev-utils-webpack5/formatWebpackMessages.js b/packages/docusaurus/src/webpack/react-dev-utils-webpack5/formatWebpackMessages.js index 81cc4bb333..047e1e57bf 100644 --- a/packages/docusaurus/src/webpack/react-dev-utils-webpack5/formatWebpackMessages.js +++ b/packages/docusaurus/src/webpack/react-dev-utils-webpack5/formatWebpackMessages.js @@ -38,7 +38,7 @@ function formatMessage(message) { } // 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)); // Transform parsing error into syntax error diff --git a/website/_dogfooding/dogfooding.config.js b/website/_dogfooding/dogfooding.config.js index 099f838195..f5b2e6b34b 100644 --- a/website/_dogfooding/dogfooding.config.js +++ b/website/_dogfooding/dogfooding.config.js @@ -22,7 +22,7 @@ exports.dogfoodingPluginInstances = [ path: '_dogfooding/_blog tests', routeBasePath: '/tests/blog', 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, feedOptions: { type: 'all', diff --git a/website/blog/2019-12-30-docusaurus-2019-recap.md b/website/blog/2019-12-30-docusaurus-2019-recap.md index 138ea82de5..850754a990 100644 --- a/website/blog/2019-12-30-docusaurus-2019-recap.md +++ b/website/blog/2019-12-30-docusaurus-2019-recap.md @@ -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. -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 @@ -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: -- [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) - [Render](https://render.com/docs/deploy-docusaurus) diff --git a/website/blog/2021-03-09-releasing-docusaurus-i18n.md b/website/blog/2021-03-09-releasing-docusaurus-i18n.md index eca3b63427..61e8cdcf65 100644 --- a/website/blog/2021-03-09-releasing-docusaurus-i18n.md +++ b/website/blog/2021-03-09-releasing-docusaurus-i18n.md @@ -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 - **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 -- **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 diff --git a/website/community/3-contributing.md b/website/community/3-contributing.md index a5282ee9d1..7264cd08a8 100644 --- a/website/community/3-contributing.md +++ b/website/community/3-contributing.md @@ -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: -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. 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 Jest tests pass (`yarn test`). 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} diff --git a/website/community/4-canary.md b/website/community/4-canary.md index c84f647690..86c3f8351b 100644 --- a/website/community/4-canary.md +++ b/website/community/4-canary.md @@ -16,7 +16,7 @@ A canary release passes all automated tests, and is used in production by the Do ## 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: diff --git a/website/docs/api/plugins/plugin-content-blog.md b/website/docs/api/plugins/plugin-content-blog.md index 4f55cd768c..5c1b89dc9e 100644 --- a/website/docs/api/plugins/plugin-content-blog.md +++ b/website/docs/api/plugins/plugin-content-blog.md @@ -83,10 +83,10 @@ Most Docusaurus users configure this plugin through the [preset options](#ex-con const config = { path: 'blog', // 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 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, blogTitle: 'Blog title', diff --git a/website/docs/api/plugins/plugin-content-docs.md b/website/docs/api/plugins/plugin-content-docs.md index 42e95defe6..12260289a1 100644 --- a/website/docs/api/plugins/plugin-content-docs.md +++ b/website/docs/api/plugins/plugin-content-docs.md @@ -109,10 +109,10 @@ Most Docusaurus users configure this plugin through the [preset options](#ex-con const config = { path: 'docs', // 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 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, editCurrentVersion: false, routeBasePath: 'docs', @@ -263,7 +263,7 @@ hide_table_of_contents: false sidebar_label: Markdown sidebar_position: 3 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 keywords: - docs diff --git a/website/docs/deployment.mdx b/website/docs/deployment.mdx index 016bd2be4c..c23b8b5fbb 100644 --- a/website/docs/deployment.mdx +++ b/website/docs/deployment.mdx @@ -127,8 +127,8 @@ Optional parameters, also set as environment variables: | Name | Description | | --- | --- | | `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`. | -| `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. | +| `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 `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) | 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' branches: only: - - master + - main cache: yarn: true script: @@ -279,7 +279,7 @@ script: - 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} @@ -312,7 +312,7 @@ After creating this simple pipeline, each new commit pushed to the branch you se ```yaml title="azure-pipelines.yml" trigger: - - master + - main pool: vmImage: 'ubuntu-latest' @@ -329,7 +329,7 @@ steps: - script: | git config --global user.name "${GH_NAME}" 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 yarn && GIT_USER="${GH_NAME}" yarn deploy 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. -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 diff --git a/website/docs/guides/docs/versioning.md b/website/docs/guides/docs/versioning.md index 583a5f1394..e62511dbbb 100644 --- a/website/docs/guides/docs/versioning.md +++ b/website/docs/guides/docs/versioning.md @@ -20,8 +20,8 @@ To better understand how versioning works and see if it suits your needs, you ca ```shell website -├── sidebars.json # sidebar for master (next) version -├── docs # docs directory for master (next) version +├── sidebars.json # sidebar for the current docs version +├── docs # docs directory for the current docs version │ ├── foo │ │ └── bar.md # https://mysite.com/docs/next/foo/bar │ └── 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.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} -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. ```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. Include the reference for the new file into the corresponding sidebar file, according to version number. -**Master docs** +**Current version docs** ```shell # The new file. @@ -82,7 +90,7 @@ docs/new.md sidebar.js ``` -**Older docs** +**Older version docs** ```shell # The new file. diff --git a/website/docs/i18n/i18n-crowdin.mdx b/website/docs/i18n/i18n-crowdin.mdx index 84b25b9ed8..98cccdf274 100644 --- a/website/docs/i18n/i18n-crowdin.mdx +++ b/website/docs/i18n/i18n-crowdin.mdx @@ -484,7 +484,7 @@ module.exports = { return `https://crowdin.com/project/docusaurus-v2/${locale}`; } // 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 }, @@ -494,7 +494,7 @@ module.exports = { if (locale !== DefaultLocale) { 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 }, diff --git a/website/docs/i18n/i18n-introduction.md b/website/docs/i18n/i18n-introduction.md index 7c2a0e2fa8..83bc7390df 100644 --- a/website/docs/i18n/i18n-introduction.md +++ b/website/docs/i18n/i18n-introduction.md @@ -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 - **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 -- **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} diff --git a/website/docs/i18n/i18n-tutorial.md b/website/docs/i18n/i18n-tutorial.md index c4c58d656e..61149335e8 100644 --- a/website/docs/i18n/i18n-tutorial.md +++ b/website/docs/i18n/i18n-tutorial.md @@ -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**. -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} @@ -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. -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)**. ::: diff --git a/website/docs/installation.md b/website/docs/installation.md index cdb885c84f..8e99c39d00 100644 --- a/website/docs/installation.md +++ b/website/docs/installation.md @@ -3,7 +3,7 @@ id: 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 diff --git a/website/docs/migration/migration-manual.md b/website/docs/migration/migration-manual.md index 825bc1474f..5c477cf38e 100644 --- a/website/docs/migration/migration-manual.md +++ b/website/docs/migration/migration-manual.md @@ -122,7 +122,7 @@ yarn-error.log* ### `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} @@ -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. @@ -342,7 +342,7 @@ module.exports = { // Equivalent to `customDocsPath`. path: '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`. routeBasePath: 'docs', // 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: -- 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/) -- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support) +- 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/main/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support) ## Content {#content} diff --git a/website/docs/migration/migration-translated-sites.md b/website/docs/migration/migration-translated-sites.md index 99d5dc4deb..677eb32fdd 100644 --- a/website/docs/migration/migration-translated-sites.md +++ b/website/docs/migration/migration-translated-sites.md @@ -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. -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} diff --git a/website/docusaurus.config-blog-only.js b/website/docusaurus.config-blog-only.js index 6f7bf24f36..33bca3ed33 100644 --- a/website/docusaurus.config-blog-only.js +++ b/website/docusaurus.config-blog-only.js @@ -26,8 +26,7 @@ module.exports = { blog: { routeBasePath: '/', path: 'blog', - editUrl: - 'https://github.com/facebook/docusaurus/edit/master/website/', + editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', postsPerPage: 3, feedOptions: { type: 'all', diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 36cb531a3f..72cfbd8adf 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -112,7 +112,7 @@ const TwitterSvg = if (locale !== 'en') { 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, sidebarPath: require.resolve('./sidebarsCommunity.js'), @@ -239,7 +239,7 @@ const TwitterSvg = // We want users to submit doc updates to the upstream/next version! // Otherwise we risk losing the update on the next release. 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, showLastUpdateTime: true, @@ -267,7 +267,7 @@ const TwitterSvg = if (locale !== 'en') { 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, feedOptions: { diff --git a/website/src/data/users.tsx b/website/src/data/users.tsx index dc5b7cec0f..a98b6d00ad 100644 --- a/website/src/data/users.tsx +++ b/website/src/data/users.tsx @@ -979,7 +979,7 @@ const Users: User[] = [ description: 'The GraphQL client that scales with you', preview: require('./showcase/relay.png'), 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'], }, { diff --git a/website/src/pages/showcase/index.tsx b/website/src/pages/showcase/index.tsx index 6e40bee6be..a0209608ee 100644 --- a/website/src/pages/showcase/index.tsx +++ b/website/src/pages/showcase/index.tsx @@ -23,7 +23,7 @@ type Operator = 'OR' | 'AND'; const TITLE = 'Docusaurus Site Showcase'; const DESCRIPTION = 'List of websites people are building with Docusaurus'; 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( users: User[], diff --git a/website/versioned_docs/version-2.0.0-beta.3/api/plugins/plugin-content-blog.md b/website/versioned_docs/version-2.0.0-beta.3/api/plugins/plugin-content-blog.md index 9539fb88e2..628675cbc1 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/api/plugins/plugin-content-blog.md +++ b/website/versioned_docs/version-2.0.0-beta.3/api/plugins/plugin-content-blog.md @@ -34,12 +34,12 @@ module.exports = { * Base url to edit your site. * 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. */ 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. diff --git a/website/versioned_docs/version-2.0.0-beta.3/api/plugins/plugin-content-docs.md b/website/versioned_docs/version-2.0.0-beta.3/api/plugins/plugin-content-docs.md index a352a50040..fde5037fb2 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/api/plugins/plugin-content-docs.md +++ b/website/versioned_docs/version-2.0.0-beta.3/api/plugins/plugin-content-docs.md @@ -34,7 +34,7 @@ module.exports = { * Base url to edit your site. * 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. */ @@ -45,7 +45,7 @@ module.exports = { docPath, 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. @@ -171,7 +171,7 @@ module.exports = { */ versions: { /* - Example configuration: + Example configuration: current: { label: 'Android SDK v2.0.0 (WIP)', path: 'android-2.0.0', @@ -224,7 +224,7 @@ hide_table_of_contents: false sidebar_label: Markdown sidebar_position: 3 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 keywords: - docs diff --git a/website/versioned_docs/version-2.0.0-beta.3/deployment.mdx b/website/versioned_docs/version-2.0.0-beta.3/deployment.mdx index 06abd6ea39..bc25c720e7 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/deployment.mdx +++ b/website/versioned_docs/version-2.0.0-beta.3/deployment.mdx @@ -127,8 +127,8 @@ Optional parameters, also set as environment variables: | Name | Description | | --- | --- | | `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`. | -| `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. | +| `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 `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) | 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' branches: only: - - master + - main cache: yarn: true script: @@ -279,7 +279,7 @@ script: - 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} @@ -312,7 +312,7 @@ After creating this simple pipeline, each new commit pushed to the branch you se ```yaml title="azure-pipelines.yml" trigger: - - master + - main pool: vmImage: 'ubuntu-latest' @@ -329,7 +329,7 @@ steps: - script: | git config --global user.name "${GH_NAME}" 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 yarn && GIT_USER="${GH_NAME}" yarn deploy 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. -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 diff --git a/website/versioned_docs/version-2.0.0-beta.3/guides/docs/versioning.md b/website/versioned_docs/version-2.0.0-beta.3/guides/docs/versioning.md index 583a5f1394..e62511dbbb 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/guides/docs/versioning.md +++ b/website/versioned_docs/version-2.0.0-beta.3/guides/docs/versioning.md @@ -20,8 +20,8 @@ To better understand how versioning works and see if it suits your needs, you ca ```shell website -├── sidebars.json # sidebar for master (next) version -├── docs # docs directory for master (next) version +├── sidebars.json # sidebar for the current docs version +├── docs # docs directory for the current docs version │ ├── foo │ │ └── bar.md # https://mysite.com/docs/next/foo/bar │ └── 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.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} -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. ```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. Include the reference for the new file into the corresponding sidebar file, according to version number. -**Master docs** +**Current version docs** ```shell # The new file. @@ -82,7 +90,7 @@ docs/new.md sidebar.js ``` -**Older docs** +**Older version docs** ```shell # The new file. diff --git a/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-crowdin.mdx b/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-crowdin.mdx index 84b25b9ed8..98cccdf274 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-crowdin.mdx +++ b/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-crowdin.mdx @@ -484,7 +484,7 @@ module.exports = { return `https://crowdin.com/project/docusaurus-v2/${locale}`; } // 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 }, @@ -494,7 +494,7 @@ module.exports = { if (locale !== DefaultLocale) { 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 }, diff --git a/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-introduction.md b/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-introduction.md index 7c2a0e2fa8..83bc7390df 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-introduction.md +++ b/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-introduction.md @@ -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 - **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 -- **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} diff --git a/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-tutorial.md b/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-tutorial.md index c4c58d656e..61149335e8 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-tutorial.md +++ b/website/versioned_docs/version-2.0.0-beta.3/i18n/i18n-tutorial.md @@ -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**. -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} @@ -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. -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)**. ::: diff --git a/website/versioned_docs/version-2.0.0-beta.3/installation.md b/website/versioned_docs/version-2.0.0-beta.3/installation.md index f418d4e6b0..5d079d348d 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/installation.md +++ b/website/versioned_docs/version-2.0.0-beta.3/installation.md @@ -3,7 +3,7 @@ id: 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 diff --git a/website/versioned_docs/version-2.0.0-beta.3/migration/migration-manual.md b/website/versioned_docs/version-2.0.0-beta.3/migration/migration-manual.md index 34611bb837..a1cdc37836 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/migration/migration-manual.md +++ b/website/versioned_docs/version-2.0.0-beta.3/migration/migration-manual.md @@ -122,7 +122,7 @@ yarn-error.log* ### `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} @@ -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. @@ -344,7 +344,7 @@ module.exports = { // Equivalent to `customDocsPath`. path: '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`. routeBasePath: 'docs', // 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: -- 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/) -- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support) +- 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/main/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support) ## Content {#content} diff --git a/website/versioned_docs/version-2.0.0-beta.3/migration/migration-translated-sites.md b/website/versioned_docs/version-2.0.0-beta.3/migration/migration-translated-sites.md index 99d5dc4deb..677eb32fdd 100644 --- a/website/versioned_docs/version-2.0.0-beta.3/migration/migration-translated-sites.md +++ b/website/versioned_docs/version-2.0.0-beta.3/migration/migration-translated-sites.md @@ -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. -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} diff --git a/website/versioned_docs/version-2.0.0-beta.4/api/plugins/plugin-content-blog.md b/website/versioned_docs/version-2.0.0-beta.4/api/plugins/plugin-content-blog.md index b7e368e77b..d28d57f7b8 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/api/plugins/plugin-content-blog.md +++ b/website/versioned_docs/version-2.0.0-beta.4/api/plugins/plugin-content-blog.md @@ -34,12 +34,12 @@ module.exports = { * Base url to edit your site. * 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. */ 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. diff --git a/website/versioned_docs/version-2.0.0-beta.4/api/plugins/plugin-content-docs.md b/website/versioned_docs/version-2.0.0-beta.4/api/plugins/plugin-content-docs.md index 39038cc71f..dc0546e7e1 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/api/plugins/plugin-content-docs.md +++ b/website/versioned_docs/version-2.0.0-beta.4/api/plugins/plugin-content-docs.md @@ -35,7 +35,7 @@ module.exports = { * Docusaurus will compute the final editUrl with "editUrl + relativeDocPath" * 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. */ @@ -46,7 +46,7 @@ module.exports = { docPath, 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. @@ -191,7 +191,7 @@ module.exports = { */ versions: { /* - Example configuration: + Example configuration: current: { label: 'Android SDK v2.0.0 (WIP)', path: 'android-2.0.0', @@ -244,7 +244,7 @@ hide_table_of_contents: false sidebar_label: Markdown sidebar_position: 3 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 keywords: - docs diff --git a/website/versioned_docs/version-2.0.0-beta.4/deployment.mdx b/website/versioned_docs/version-2.0.0-beta.4/deployment.mdx index 016bd2be4c..c23b8b5fbb 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/deployment.mdx +++ b/website/versioned_docs/version-2.0.0-beta.4/deployment.mdx @@ -127,8 +127,8 @@ Optional parameters, also set as environment variables: | Name | Description | | --- | --- | | `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`. | -| `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. | +| `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 `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) | 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' branches: only: - - master + - main cache: yarn: true script: @@ -279,7 +279,7 @@ script: - 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} @@ -312,7 +312,7 @@ After creating this simple pipeline, each new commit pushed to the branch you se ```yaml title="azure-pipelines.yml" trigger: - - master + - main pool: vmImage: 'ubuntu-latest' @@ -329,7 +329,7 @@ steps: - script: | git config --global user.name "${GH_NAME}" 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 yarn && GIT_USER="${GH_NAME}" yarn deploy 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. -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 diff --git a/website/versioned_docs/version-2.0.0-beta.4/guides/docs/versioning.md b/website/versioned_docs/version-2.0.0-beta.4/guides/docs/versioning.md index 583a5f1394..e62511dbbb 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/guides/docs/versioning.md +++ b/website/versioned_docs/version-2.0.0-beta.4/guides/docs/versioning.md @@ -20,8 +20,8 @@ To better understand how versioning works and see if it suits your needs, you ca ```shell website -├── sidebars.json # sidebar for master (next) version -├── docs # docs directory for master (next) version +├── sidebars.json # sidebar for the current docs version +├── docs # docs directory for the current docs version │ ├── foo │ │ └── bar.md # https://mysite.com/docs/next/foo/bar │ └── 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.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} -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. ```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. Include the reference for the new file into the corresponding sidebar file, according to version number. -**Master docs** +**Current version docs** ```shell # The new file. @@ -82,7 +90,7 @@ docs/new.md sidebar.js ``` -**Older docs** +**Older version docs** ```shell # The new file. diff --git a/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-crowdin.mdx b/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-crowdin.mdx index 84b25b9ed8..98cccdf274 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-crowdin.mdx +++ b/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-crowdin.mdx @@ -484,7 +484,7 @@ module.exports = { return `https://crowdin.com/project/docusaurus-v2/${locale}`; } // 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 }, @@ -494,7 +494,7 @@ module.exports = { if (locale !== DefaultLocale) { 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 }, diff --git a/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-introduction.md b/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-introduction.md index 7c2a0e2fa8..83bc7390df 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-introduction.md +++ b/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-introduction.md @@ -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 - **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 -- **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} diff --git a/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-tutorial.md b/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-tutorial.md index c4c58d656e..61149335e8 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-tutorial.md +++ b/website/versioned_docs/version-2.0.0-beta.4/i18n/i18n-tutorial.md @@ -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**. -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} @@ -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. -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)**. ::: diff --git a/website/versioned_docs/version-2.0.0-beta.4/installation.md b/website/versioned_docs/version-2.0.0-beta.4/installation.md index f418d4e6b0..5d079d348d 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/installation.md +++ b/website/versioned_docs/version-2.0.0-beta.4/installation.md @@ -3,7 +3,7 @@ id: 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 diff --git a/website/versioned_docs/version-2.0.0-beta.4/migration/migration-manual.md b/website/versioned_docs/version-2.0.0-beta.4/migration/migration-manual.md index 825bc1474f..5c477cf38e 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/migration/migration-manual.md +++ b/website/versioned_docs/version-2.0.0-beta.4/migration/migration-manual.md @@ -122,7 +122,7 @@ yarn-error.log* ### `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} @@ -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. @@ -342,7 +342,7 @@ module.exports = { // Equivalent to `customDocsPath`. path: '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`. routeBasePath: 'docs', // 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: -- 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/) -- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support) +- 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/main/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support) ## Content {#content} diff --git a/website/versioned_docs/version-2.0.0-beta.4/migration/migration-translated-sites.md b/website/versioned_docs/version-2.0.0-beta.4/migration/migration-translated-sites.md index 99d5dc4deb..677eb32fdd 100644 --- a/website/versioned_docs/version-2.0.0-beta.4/migration/migration-translated-sites.md +++ b/website/versioned_docs/version-2.0.0-beta.4/migration/migration-translated-sites.md @@ -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. -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} diff --git a/website/waitForCrowdin.js b/website/waitForCrowdin.js index 0b3d996061..95947804ea 100644 --- a/website/waitForCrowdin.js +++ b/website/waitForCrowdin.js @@ -11,7 +11,7 @@ const {Translations} = require('@crowdin/crowdin-api-client'); Crowdin does not support concurrent "project builds" (downloads of translations). 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 - i18n-staging (work-in-progress locales)