fix: Docs redirect to new domain (#853)

This commit is contained in:
Oliver Windall Juhl
2021-12-01 15:39:01 +01:00
committed by GitHub
parent 1de0b28f38
commit 33bdb8f06c
7 changed files with 2567 additions and 2947 deletions
+3
View File
@@ -0,0 +1,3 @@
https://www.docs.medusa-commerce.com/* https://www.docs.medusajs.com/:splat 301!
https://docs.medusa-commerce.com/* https://docs.medusajs.com/:splat 301!
https://tender-goodall-28ca2e.netlify.app/* https://www.docs.medusajs.com/:splat 301!
+18 -17
View File
@@ -1,42 +1,43 @@
#!/usr/bin/env node
const execa = require("execa");
const execa = require("execa")
const installDeps = async () => {
await execa("yarn", ["install"], {
cwd: "./reference",
stdio: "inherit",
});
})
await execa("yarn", ["install"], {
cwd: "./docs",
stdio: "inherit",
});
};
})
}
const buildGatsby = async () => {
await execa("./node_modules/.bin/gatsby", ["build"], {
cwd: "./reference",
stdio: "inherit",
});
};
})
}
const buildDocusaurus = async () => {
await execa("./node_modules/.bin/docusaurus", ["build"], {
cwd: "./docs",
stdio: "inherit",
});
};
})
}
const buildSite = async () => {
await installDeps();
await buildGatsby();
await buildDocusaurus();
await installDeps()
await buildGatsby()
await buildDocusaurus()
await execa("rm", ["-rf", "build"]);
await execa("mkdir", ["build"]);
await execa("cp", ["-a", `reference/public/.`, `build/`]);
await execa("cp", ["-a", `docs/build/.`, `build/`]);
};
await execa("rm", ["-rf", "build"])
await execa("mkdir", ["build"])
await execa("cp", ["_redirects", "build/_redirects"])
await execa("cp", ["-a", `reference/public/.`, `build/`])
await execa("cp", ["-a", `docs/build/.`, `build/`])
}
buildSite();
buildSite()
+3 -3
View File
@@ -8,7 +8,7 @@ const algoliaApiKey = process.env.ALGOLIA_API_KEY || "temp"
module.exports = {
title: "Medusa Commerce",
tagline: "Explore and learn how to use Medusa",
url: "https://docs.medusa-commerce.com",
url: "https://docs.medusajs.com",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
@@ -47,7 +47,7 @@ module.exports = {
},
items: [
{
href: "https://docs.medusa-commerce.com",
href: "https://docs.medusajs.com",
label: "Overview",
},
{
@@ -56,7 +56,7 @@ module.exports = {
label: "Tutorial",
},
{
href: `https://docs.medusa-commerce.com/api/store`,
href: `https://docs.medusajs.com/api/store`,
target: "_self",
label: "Reference",
},
+1 -1
View File
@@ -134,7 +134,7 @@ function DocSearch({ contextualSearch, ...props }) {
const url = replaceUrl(item)
// Need to type out the entire URL to prevent it from attempting to open the page
// as part of the docusaurus project. Which will fail.
window.location = `https://docs.medusa-commerce.com${url}`
window.location = `https://docs.medusajs.com${url}`
},
navigateNewTab({ item }) {
const url = replaceUrl(item)
+1 -1
View File
@@ -1,3 +1,3 @@
# Medusa Docs
Visit: docs.medusa-commerce.com to browse docs.
Visit: docs.medusajs.com to browse docs.
+4 -4
View File
@@ -1,13 +1,13 @@
import { Flex, Box, Link, Select } from "@theme-ui/components"
import React, { useContext } from "react"
import { Box, Flex, Link, Select } from "@theme-ui/components"
import { navigate } from "gatsby-link"
import React, { useContext } from "react"
import GitHub from "../components/icons/github"
import NavigationContext from "../context/navigation-context"
import { convertToKebabCase } from "../utils/convert-to-kebab-case"
import ChevronDown from "./icons/chevron-down"
import Search from "./search"
const Topbar = ({ data, api }) => {
const { goTo, reset, currentSection } = useContext(NavigationContext)
@@ -100,7 +100,7 @@ const Topbar = ({ data, api }) => {
justifyContent: "flex-end",
}}
>
<Link variant="topbar" mr={3} href="https://docs.medusa-commerce.com">
<Link variant="topbar" mr={3} href="https://docs.medusajs.com">
Docs
</Link>
<Link
+2537 -2921
View File
File diff suppressed because it is too large Load Diff