Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display the new changelog page #528

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions apps/web/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
landingPageHostname,
landingPageFramerHostname,
blogFramerHostname,
changelogFramerHostname,
} from '@/app/hostnames'

export async function middleware(req: NextRequest): Promise<NextResponse> {
Expand Down Expand Up @@ -39,6 +38,10 @@ export async function middleware(req: NextRequest): Promise<NextResponse> {
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
Expand All @@ -52,14 +55,6 @@ export async function middleware(req: NextRequest): Promise<NextResponse> {
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()
Expand Down
9 changes: 0 additions & 9 deletions apps/web/src/utils/replaceUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
landingPageHostname,
landingPageFramerHostname,
blogFramerHostname,
changelogFramerHostname,
} from '@/app/hostnames'

export function replaceUrls(text: string, urlPathName: string, prefix: string = '', suffix: string = ''): string {
Expand All @@ -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`
)
}
Loading