From 8d64a4a20d9f9cc157eeb02a914d1cb5ca22d453 Mon Sep 17 00:00:00 2001 From: Christoph Bartschat Date: Mon, 30 Mar 2026 11:15:57 -0700 Subject: [PATCH] Add configuration for routing featured projects to their published domain --- src/pages/index.jsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pages/index.jsx b/src/pages/index.jsx index b257c6d..738f03c 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -8,11 +8,24 @@ const REDIRECTS = { 'tutorials': 'https://youtube.com/@8thwall', } +// NOTE(christoph): If a user is linked to a featured project page such as +// https://8thwall.com/workspace/project, they will be redirected to +// 8thwall.org?site_path=workspace/project. We can then forward that to the published domain: +// https://workspace.8thwall.app/project +const PUBLISHED_DOMAIN_REDIRECTS = [ + 'mindoverdevelopment', +] + 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]); +} else { + const domainRedirect = ${JSON.stringify(PUBLISHED_DOMAIN_REDIRECTS)}.find(domain => sitePath.startsWith(domain + '/')); + if (domainRedirect) { + window.location.replace('https://' + domainRedirect + '.8thwall.app/' + sitePath.substring(domainRedirect.length + 1)); + } } `