Skip to content

Commit

Permalink
Added redirects (MetaMask#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas authored Mar 30, 2023
1 parent f63e1ad commit d7d9ba7
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 55 deletions.
117 changes: 117 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,122 @@ const config = {
breadcrumbs: false,
}),
],
[
"@docusaurus/plugin-client-redirects",
{
fromExtensions: ["html", "htm"],
redirects: [
{
from: "/guide/",
to: "/wallet/",
},
{
from: "/guide/getting-started",
to: "/wallet/get-started/set-up-dev-environment",
},
{
from: "/guide/common-terms",
to: "/wallet/",
},
{
from: "/guide/initializing-dapps",
to: "/wallet/how-to/interact-with-smart-contracts",
},
{
from: "/guide/accessing-accounts",
to: "/wallet/get-started/access-accounts",
},
{
from: "/guide/sending-transactions",
to: "/wallet/how-to/send-transactions",
},
{
from: "/guide/ethereum-provider",
to: "/wallet/reference/provider-api",
},
{
from: "/guide/provider-migration",
to: "/wallet/how-to/migrate-api",
},
{
from: "/guide/rpc-api",
to: "/wallet/reference/rpc-api",
},
{
from: "/guide/signing-data",
to: "/wallet/how-to/sign-data",
},
{
from: "/guide/registering-function-names",
to: "/wallet/how-to/register-method-names",
},
{
from: "/guide/registering-your-token",
to: "/wallet/how-to/register-token",
},
{
from: "/guide/defining-your-icon",
to: "/wallet/how-to/set-icon",
},
{
from: "/guide/onboarding-library",
to: "/wallet/how-to/use-onboarding-library",
},
{
from: "/guide/metamask-extension-provider",
to: "/wallet/how-to/access-provider",
},
{
from: "/guide/mobile-getting-started",
to: "/wallet/how-to/use-mobile",
},
{
from: "/guide/site-compatibility-checklist",
to: "/wallet/how-to/use-mobile",
},
{
from: "/guide/mobile-best-practices",
to: "/wallet/how-to/use-mobile",
},
{
from: "/guide/snaps",
to: "/snaps/",
},
{
from: "/guide/snaps-development-guide",
to: "/snaps/how-to/develop-a-snap",
},
{
from: "/guide/snaps-concepts",
to: "/snaps/category/concepts",
},
{
from: "/guide/snaps-rpc-api",
to: "/snaps/reference/rpc-api",
},
{
from: "/guide/snaps-permissions",
to: "/snaps/how-to/request-permissions",
},
{
from: "/guide/snaps-exports",
to: "/snaps/reference/exports",
},
{
from: "/guide/snaps-patching-dependencies",
to: "/snaps/how-to/troubleshoot",
},
{
from: "/guide/create-dapp",
to: "/wallet/get-started/set-up-dev-environment",
},
{
from: "/guide/contributors",
to: "/wallet/",
},
],
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
Expand All @@ -72,6 +188,7 @@ const config = {
logo: {
alt: "MetaMask logo",
src: "img/metamask-fox.svg",
href: "/wallet/",
},
items: [
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"devDependencies": {
"@docusaurus/eslint-plugin": "^2.2.0",
"@docusaurus/module-type-aliases": "2.2.0",
"@docusaurus/plugin-client-redirects": "2.2.0",
"@lavamoat/allow-scripts": "^2.3.0",
"@tsconfig/docusaurus": "^1.0.5",
"@typescript-eslint/eslint-plugin": "^5.41.0",
Expand Down
23 changes: 0 additions & 23 deletions src/pages/index.module.css

This file was deleted.

32 changes: 0 additions & 32 deletions src/pages/index.tsx

This file was deleted.

18 changes: 18 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta
http-equiv="refresh"
content="0; url=/wallet/"
/>
<script type="text/javascript">
window.location.href = '/wallet/';
</script>
<title>MetaMask Documentation</title>
</head>
<body>
If you are not redirected automatically, follow this
<a href="/wallet/">link</a>.
</body>
</html>
21 changes: 21 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1836,6 +1836,26 @@ __metadata:
languageName: node
linkType: hard

"@docusaurus/plugin-client-redirects@npm:2.2.0":
version: 2.2.0
resolution: "@docusaurus/plugin-client-redirects@npm:2.2.0"
dependencies:
"@docusaurus/core": 2.2.0
"@docusaurus/logger": 2.2.0
"@docusaurus/utils": 2.2.0
"@docusaurus/utils-common": 2.2.0
"@docusaurus/utils-validation": 2.2.0
eta: ^1.12.3
fs-extra: ^10.1.0
lodash: ^4.17.21
tslib: ^2.4.0
peerDependencies:
react: ^16.8.4 || ^17.0.0
react-dom: ^16.8.4 || ^17.0.0
checksum: dfe7804af8f621a04840223b7726d3cc7d4a6a68930ecedebeff718fbe0dedfcfc0d8e69fb49bcfb5ec797acb84d5119a9385c39d37676328f1b6a3b99ca6232
languageName: node
linkType: hard

"@docusaurus/plugin-content-blog@npm:2.2.0":
version: 2.2.0
resolution: "@docusaurus/plugin-content-blog@npm:2.2.0"
Expand Down Expand Up @@ -9420,6 +9440,7 @@ __metadata:
"@docusaurus/core": 2.2.0
"@docusaurus/eslint-plugin": ^2.2.0
"@docusaurus/module-type-aliases": 2.2.0
"@docusaurus/plugin-client-redirects": 2.2.0
"@docusaurus/preset-classic": 2.2.0
"@lavamoat/allow-scripts": ^2.3.0
"@mdx-js/react": ^1.6.22
Expand Down

0 comments on commit d7d9ba7

Please sign in to comment.