diff --git a/docs/next.config.js b/docs/next.config.js index ddb497d8..d148ead0 100644 --- a/docs/next.config.js +++ b/docs/next.config.js @@ -8,13 +8,6 @@ const nextConfig = { unoptimized: true, }, output: "export", - redirects: () => [ - { - source: "/", - destination: "https://docs.identitykit.xyz/", - permanent: true, - }, - ], } const withNextra = require("nextra")({ diff --git a/docs/pages/_app.mdx b/docs/pages/_app.mdx deleted file mode 100644 index 63b9c71b..00000000 --- a/docs/pages/_app.mdx +++ /dev/null @@ -1,5 +0,0 @@ -import "@/styles/globals.css" - -export default function App({ Component, pageProps }) { - return -} diff --git a/docs/pages/_app.tsx b/docs/pages/_app.tsx new file mode 100644 index 00000000..a13816b0 --- /dev/null +++ b/docs/pages/_app.tsx @@ -0,0 +1,19 @@ +import "@/styles/globals.css" + +import { useRouter } from "next/router" +import { useEffect } from "react" + +export default function MyApp() { + const router = useRouter() + + useEffect(() => { + // Redirect all pages to the external URL + const externalUrl = "https://docs.identitykit.xyz/" + if (router.pathname !== "/_error") { + // Avoid infinite loop if there's an error + window.location.href = externalUrl + } + }, [router]) + + return null // Prevents rendering any content since we're redirecting +}