fix: Docs redirect to new domain (#853)
This commit is contained in:
committed by
GitHub
parent
1de0b28f38
commit
33bdb8f06c
@@ -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
@@ -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()
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
|
||||
@@ -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,3 +1,3 @@
|
||||
# Medusa Docs
|
||||
|
||||
Visit: docs.medusa-commerce.com to browse docs.
|
||||
Visit: docs.medusajs.com to browse docs.
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user