fix: Docs redirect to new domain (#853)
This commit is contained in:
1 parent
1de0b28f38
commit
33bdb8f06c
7 files changed
+2567
-2947
No files matched your search
@@ -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
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const execa = require("execa");
|
const execa = require("execa")
|
||||||
|
|
||||||
const installDeps = async () => {
|
const installDeps = async () => {
|
||||||
await execa("yarn", ["install"], {
|
await execa("yarn", ["install"], {
|
||||||
cwd: "./reference",
|
cwd: "./reference",
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
});
|
})
|
||||||
|
|
||||||
await execa("yarn", ["install"], {
|
await execa("yarn", ["install"], {
|
||||||
cwd: "./docs",
|
cwd: "./docs",
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const buildGatsby = async () => {
|
const buildGatsby = async () => {
|
||||||
await execa("./node_modules/.bin/gatsby", ["build"], {
|
await execa("./node_modules/.bin/gatsby", ["build"], {
|
||||||
cwd: "./reference",
|
cwd: "./reference",
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const buildDocusaurus = async () => {
|
const buildDocusaurus = async () => {
|
||||||
await execa("./node_modules/.bin/docusaurus", ["build"], {
|
await execa("./node_modules/.bin/docusaurus", ["build"], {
|
||||||
cwd: "./docs",
|
cwd: "./docs",
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const buildSite = async () => {
|
const buildSite = async () => {
|
||||||
await installDeps();
|
await installDeps()
|
||||||
await buildGatsby();
|
await buildGatsby()
|
||||||
await buildDocusaurus();
|
await buildDocusaurus()
|
||||||
|
|
||||||
await execa("rm", ["-rf", "build"]);
|
await execa("rm", ["-rf", "build"])
|
||||||
await execa("mkdir", ["build"]);
|
await execa("mkdir", ["build"])
|
||||||
await execa("cp", ["-a", `reference/public/.`, `build/`]);
|
await execa("cp", ["_redirects", "build/_redirects"])
|
||||||
await execa("cp", ["-a", `docs/build/.`, `build/`]);
|
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 = {
|
module.exports = {
|
||||||
title: "Medusa Commerce",
|
title: "Medusa Commerce",
|
||||||
tagline: "Explore and learn how to use Medusa",
|
tagline: "Explore and learn how to use Medusa",
|
||||||
url: "https://docs.medusa-commerce.com",
|
url: "https://docs.medusajs.com",
|
||||||
baseUrl: "/",
|
baseUrl: "/",
|
||||||
onBrokenLinks: "throw",
|
onBrokenLinks: "throw",
|
||||||
onBrokenMarkdownLinks: "warn",
|
onBrokenMarkdownLinks: "warn",
|
||||||
@@ -47,7 +47,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
href: "https://docs.medusa-commerce.com",
|
href: "https://docs.medusajs.com",
|
||||||
label: "Overview",
|
label: "Overview",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -56,7 +56,7 @@ module.exports = {
|
|||||||
label: "Tutorial",
|
label: "Tutorial",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: `https://docs.medusa-commerce.com/api/store`,
|
href: `https://docs.medusajs.com/api/store`,
|
||||||
target: "_self",
|
target: "_self",
|
||||||
label: "Reference",
|
label: "Reference",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ function DocSearch({ contextualSearch, ...props }) {
|
|||||||
const url = replaceUrl(item)
|
const url = replaceUrl(item)
|
||||||
// Need to type out the entire URL to prevent it from attempting to open the page
|
// 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.
|
// 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 }) {
|
navigateNewTab({ item }) {
|
||||||
const url = replaceUrl(item)
|
const url = replaceUrl(item)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# Medusa Docs
|
# 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 { Box, Flex, Link, Select } from "@theme-ui/components"
|
||||||
import React, { useContext } from "react"
|
|
||||||
import { navigate } from "gatsby-link"
|
import { navigate } from "gatsby-link"
|
||||||
|
import React, { useContext } from "react"
|
||||||
import GitHub from "../components/icons/github"
|
import GitHub from "../components/icons/github"
|
||||||
import NavigationContext from "../context/navigation-context"
|
import NavigationContext from "../context/navigation-context"
|
||||||
import { convertToKebabCase } from "../utils/convert-to-kebab-case"
|
import { convertToKebabCase } from "../utils/convert-to-kebab-case"
|
||||||
import ChevronDown from "./icons/chevron-down"
|
import ChevronDown from "./icons/chevron-down"
|
||||||
import Search from "./search"
|
import Search from "./search"
|
||||||
|
|
||||||
|
|
||||||
const Topbar = ({ data, api }) => {
|
const Topbar = ({ data, api }) => {
|
||||||
const { goTo, reset, currentSection } = useContext(NavigationContext)
|
const { goTo, reset, currentSection } = useContext(NavigationContext)
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ const Topbar = ({ data, api }) => {
|
|||||||
justifyContent: "flex-end",
|
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
|
Docs
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
|
|||||||
+2537
-2921
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user