From 41b78c005c13ca9a1ba112b3a61944f77854f2eb Mon Sep 17 00:00:00 2001 From: Christoph Bartschat Date: Fri, 31 Jul 2026 14:22:28 -0700 Subject: [PATCH] Add redirect handlers for forum and contact --- src/pages/index.jsx | 15 +-------------- src/pages/redirects.tsx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 src/pages/redirects.tsx diff --git a/src/pages/index.jsx b/src/pages/index.jsx index fd811b5..75bb9ec 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -3,20 +3,7 @@ import Link from '@docusaurus/Link'; import Layout from '@theme/Layout'; import Head from '@docusaurus/Head'; import HeroCanvas from '@site/src/components/HeroCanvas'; - -const REDIRECTS = { - 'tutorials': 'https://youtube.com/@8thwall', - 'twainxreducation/brandigno': 'https://twainxreducation.8thwall.app/brandigno/', -} - -const REDIRECT_SCRIPT = ` -const sitePath = new URLSearchParams(window.location.search).get('site_path'); -const redirects = ${JSON.stringify(REDIRECTS)}; -if (sitePath && redirects[sitePath]) { - window.location.replace(redirects[sitePath]); -} -` - +import {REDIRECT_SCRIPT} from './redirects' export default function Home() { return ( diff --git a/src/pages/redirects.tsx b/src/pages/redirects.tsx new file mode 100644 index 0000000..a0cd0ec --- /dev/null +++ b/src/pages/redirects.tsx @@ -0,0 +1,18 @@ +const REDIRECTS = { + 'tutorials': 'https://youtube.com/@8thwall', + 'twainxreducation/brandigno': 'https://twainxreducation.8thwall.app/brandigno/', + 'contact': '#get-involved', + 'forum': '#get-involved', +} + +const REDIRECT_SCRIPT = ` +const sitePath = new URLSearchParams(window.location.search).get('site_path'); +const redirects = ${JSON.stringify(REDIRECTS)}; +if (sitePath && redirects[sitePath]) { + window.location.replace(redirects[sitePath]); +} +` + +export { + REDIRECT_SCRIPT +}