Skip to content

Commit 0cd1608

Browse files
committed
fix(blog): update utm handling
1 parent 1ac1177 commit 0cd1608

4 files changed

Lines changed: 30 additions & 20 deletions

File tree

apps/blog/src/app/(blog)/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function baseOptions() {
5252
},
5353
{
5454
text: "Prisma Partners",
55-
url: "/partners",
55+
url: "https://www.prisma.io/partners",
5656
icon: "fa-regular fa-lightbulb",
5757
},
5858
{
@@ -90,7 +90,7 @@ export function baseOptions() {
9090
],
9191
},
9292
{
93-
url: "/docs",
93+
url: "https://www.prisma.io/docs",
9494
text: "Docs",
9595
},
9696
{

apps/blog/src/components/utm-persistence.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { useEffect } from "react";
44
import { usePathname, useRouter } from "next/navigation";
5+
import { BLOG_PREFIX } from "@/lib/url";
56
import {
67
clearStoredUtmParams,
78
CONSOLE_HOST,
@@ -75,12 +76,16 @@ export function UtmPersistence() {
7576
}
7677

7778
const nextHref = `${targetUrl.pathname}${targetUrl.search}${targetUrl.hash}`;
79+
const nextInternalHref =
80+
targetUrl.pathname === BLOG_PREFIX
81+
? `/${targetUrl.search}${targetUrl.hash}`
82+
: `${targetUrl.pathname.replace(new RegExp(`^${BLOG_PREFIX}`), "")}${targetUrl.search}${targetUrl.hash}`;
7883
const isModifiedClick =
7984
event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
8085

8186
if (isInternalLink && anchor.target !== "_blank" && !isModifiedClick) {
8287
event.preventDefault();
83-
router.push(nextHref);
88+
router.push(nextInternalHref);
8489
return;
8590
}
8691

apps/site/src/app/changelog/[...slug]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default async function ReleaseNotesPage({
3535
const toc = (page.data.toc as TOCItem[] | undefined) ?? [];
3636

3737
return (
38-
<main className="flex-1 w-full max-w-249 mx-auto px-4 py-8 z-1 mt-12">
38+
<main className="flex-1 w-full max-w-249 mx-auto px-4 py-8 z-1">
3939
<div className="w-full px-4 z-1 mx-auto md:grid md:grid-cols-[1fr_180px] mt-4 md:mt-22 gap-12 max-w-257">
4040
<div className="post-contents w-full">
4141
{/* Title + meta */}
@@ -46,7 +46,7 @@ export default async function ReleaseNotesPage({
4646
>
4747
← Back to Changelog
4848
</Link>
49-
<h1 className="text-4xl sm:text-5xl md:text-6xl stretch-display mb-0 text-center mt-0 font-sans-display text-foreground-neutral max-w-224 mx-auto">
49+
<h1 className="text-4xl sm:text-5xl md:text-6xl stretch-display mb-0 text-left mt-0 font-sans-display text-foreground-neutral">
5050
{page.data.title}
5151
</h1>
5252
<div className="text-sm flex gap-2 items-center text-foreground-neutral mb-4">

apps/site/src/app/changelog/page.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,27 @@ export default async function ChangelogPage() {
2828
);
2929

3030
return (
31-
<main className="flex-1 w-full max-w-249 mx-auto px-4 py-8 z-1">
32-
<section className="pt-20 pb-12 mt-10">
33-
<p className="m-0 flex items-center justify-center gap-2 text-sm font-semibold uppercase tracking-[1.8px] text-foreground-ppg">
34-
<i className="fa-regular fa-sparkles" aria-hidden />
35-
Changelog
36-
</p>
37-
<h1 className="text-4xl sm:text-5xl md:text-6xl stretch-display mb-0 text-center mt-0 font-sans-display text-foreground-neutral max-w-224 mx-auto">
38-
The Latest News from Prisma
39-
</h1>
40-
<p className="m-0 max-w-[640px] mx-auto text-center text-base text-foreground-neutral-weak md:text-lg">
41-
Here you’ll find all improvements and updates we’ve made to our
42-
products.
43-
</p>
44-
</section>
31+
<main className="flex-1 w-full z-1 bg-background-default">
32+
<div className="hero -mt-24 pt-40 flex items-end justify-center px-4 relative">
33+
<div className="absolute inset-0 pointer-events-none z-1 bg-[linear-gradient(180deg,var(--color-foreground-ppg)_0%,var(--color-background-default)_100%)] opacity-20" />
34+
<section className="content relative z-2 flex flex-col gap-8 pb-12">
35+
<div className="flex flex-col gap-4 items-center text-center">
36+
<div className="flex items-center gap-2 text-foreground-ppg-weak uppercase tracking-widest text-sm font-sans-display font-black">
37+
<i className="fa-regular fa-sparkles" aria-hidden />
38+
<span>Changelog</span>
39+
</div>
40+
<h1 className="text-4xl sm:text-5xl md:text-6xl stretch-display mb-0 text-center mt-0 font-sans-display text-foreground-neutral max-w-4xl mx-auto">
41+
The Latest News from Prisma
42+
</h1>
43+
</div>
44+
<p className="m-0 max-w-[640px] mx-auto text-center text-base text-foreground-neutral md:text-lg">
45+
Here you’ll find all improvements and updates we’ve made to our
46+
products.
47+
</p>
48+
</section>
49+
</div>
4550

46-
<section>
51+
<section className="max-w-249 mx-auto px-4 py-8">
4752
<div className="grid gap-6 mt-12 grid-cols-1">
4853
{entriesWithPreview.map(({ entry, summary }) => {
4954
const tags = entry.data.tags ?? [];

0 commit comments

Comments
 (0)