Skip to content

Commit

Permalink
Docs: Adding docusaurus redirects plugin (#774)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolzhabayev authored Feb 27, 2024
1 parent edbd2aa commit 104c787
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ Once you've filed the PR:
- If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚
- If your PR gets accepted, it will be marked as such, and merged into the `latest` branch soon after. Your contribution will be distributed to the masses once the PR is merged.

Redirects:

- In case you have to add a redirect - you can add a new entry to the config section of the following plugin `@docusaurus/plugin-client-redirects` in [docusaurus configuration file](./docusaurus/website/docusaurus.config.base.js).

## Contribute Code

We like code commits a lot! They're super handy, and they keep the project going and doing the work it needs to do to be useful to others. Before considering contributing code please review [report an error or bug](#report-an-error-or-bug) and [request a feature](#request-a-feature) to make sure an issue has been filed and discussed with the project maintainers. PRs submitted without associated issues risk being closed or rejected.
Expand All @@ -148,7 +152,7 @@ Once you've filed the PR:
- Barring special circumstances, maintainers will not review PRs until all checks pass.
- One or more maintainers will use GitHub's review feature to review your PR.
- If the maintainer asks for any changes, edit your changes, push, and ask for another review. Additional tags (such as `needs-tests`) will be added depending on the review.
- If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚
- If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's okay! We still really appreciate you taking the time to do it, and we don't take that lightly. 💚
- If your PR gets accepted, it will be marked as such, and merged into the `main` branch soon after. Your contribution will be distributed to the masses next time the maintainers [create a release](#create-a-release)

## Create A Release
Expand Down
14 changes: 14 additions & 0 deletions docusaurus/website/docusaurus.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ const plugins = [
disableVersioning: true,
},
],
[
'@docusaurus/plugin-client-redirects',
{
// how to use https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-client-redirects#ex-config
// This plugin is always inactive in development and only active in production because it works on the build output.

redirects: [
{
from: ['/something-that-does-not-exist', '/something-that-does-not-exist/testing'],
to: '/get-started/folder-structure',
},
],
},
],
];

const presetsDocs = {
Expand Down
1 change: 1 addition & 0 deletions docusaurus/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"dependencies": {
"@docusaurus/core": "^3.0.1",
"@docusaurus/plugin-client-redirects": "^3.1.1",
"@docusaurus/preset-classic": "^3.0.1",
"@iconscout/unicons": "^4.0.8",
"@mdx-js/react": "^3.0.0",
Expand Down
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 104c787

Please sign in to comment.