From 08af170c144197f501c9bed793e4463a2780656c Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Tue, 7 Jan 2025 11:57:06 -0800 Subject: [PATCH 1/2] fetch changelog route from landing page website --- apps/web/src/middleware.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index 4da0ab6e2..b30e486f0 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -4,7 +4,6 @@ import { landingPageHostname, landingPageFramerHostname, blogFramerHostname, - changelogFramerHostname, } from '@/app/hostnames' export async function middleware(req: NextRequest): Promise { @@ -39,6 +38,10 @@ export async function middleware(req: NextRequest): Promise { url.hostname = landingPageHostname } + if (url.pathname.startsWith('/changelog')) { + url.hostname = landingPageHostname + } + // TODO: Not on the new landing page hosting yet if (url.pathname.startsWith('/ai-agents')) { url.hostname = landingPageFramerHostname @@ -52,13 +55,13 @@ export async function middleware(req: NextRequest): Promise { url.hostname = blogFramerHostname } - if (url.pathname === '/changelog' || url.pathname === '/changelog/') { - url.pathname = '/' - url.hostname = changelogFramerHostname - } - if (url.pathname.startsWith('/changelog')) { - url.hostname = changelogFramerHostname - } + // if (url.pathname === '/changelog' || url.pathname === '/changelog/') { + // url.pathname = '/' + // url.hostname = changelogFramerHostname + // } + // if (url.pathname.startsWith('/changelog')) { + // url.hostname = changelogFramerHostname + // } const res = await fetch(url.toString(), { ...req }) From e7940c0e30e51df1cd4308504a3377e1d9dbc477 Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Tue, 7 Jan 2025 12:02:59 -0800 Subject: [PATCH 2/2] Remove unnecessary URL replace rule --- apps/web/src/middleware.ts | 8 -------- apps/web/src/utils/replaceUrls.ts | 9 --------- 2 files changed, 17 deletions(-) diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index b30e486f0..40c6c1af9 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -55,14 +55,6 @@ export async function middleware(req: NextRequest): Promise { url.hostname = blogFramerHostname } - // if (url.pathname === '/changelog' || url.pathname === '/changelog/') { - // url.pathname = '/' - // url.hostname = changelogFramerHostname - // } - // if (url.pathname.startsWith('/changelog')) { - // url.hostname = changelogFramerHostname - // } - const res = await fetch(url.toString(), { ...req }) const htmlBody = await res.text() diff --git a/apps/web/src/utils/replaceUrls.ts b/apps/web/src/utils/replaceUrls.ts index 0180f6650..c3e422180 100644 --- a/apps/web/src/utils/replaceUrls.ts +++ b/apps/web/src/utils/replaceUrls.ts @@ -2,7 +2,6 @@ import { landingPageHostname, landingPageFramerHostname, blogFramerHostname, - changelogFramerHostname, } from '@/app/hostnames' export function replaceUrls(text: string, urlPathName: string, prefix: string = '', suffix: string = ''): string { @@ -28,12 +27,4 @@ export function replaceUrls(text: string, urlPathName: string, prefix: string = ? `${prefix}https://e2b.dev/blog` : `${prefix}https://e2b.dev` ) - .replaceAll( - `${prefix}${changelogFramerHostname}`, - // The default url on framer does not have /changelog in the path but the custom domain does, - // so we need to handle this explicitly. - urlPathName === '/' - ? `${prefix}https://e2b.dev/changelog` - : `${prefix}https://e2b.dev` - ) } \ No newline at end of file