Skip to content

Commit daca911

Browse files
authored
fix(site): fix pricing page json-ld (#7781)
1 parent 73b5be5 commit daca911

2 files changed

Lines changed: 6 additions & 111 deletions

File tree

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

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,19 @@
1-
import { JsonLd } from "@/components/json-ld";
2-
import { createPricingStructuredData } from "@/lib/structured-data";
3-
import type { Metadata } from "next";
1+
import { createPageMetadata } from "@/lib/page-metadata";
42
import { Accordion, Accordions, Button } from "@prisma/eclipse";
53
import { faqs } from "./pricing-data";
64
import { PricingPageContent } from "./pricing-page-content";
75

8-
const pricingStructuredData = createPricingStructuredData([
9-
{
10-
name: "Free",
11-
description: "Perfect for that weekend idea. 100,000 operations and 500 MB storage included.",
12-
price: 0,
13-
billingPeriod: "month",
14-
},
15-
{
16-
name: "Starter",
17-
description: "The basics you need to launch. 1,000,000 operations and 10 GB storage included.",
18-
price: 10,
19-
billingPeriod: "month",
20-
},
21-
{
22-
name: "Pro",
23-
description: "Growing for business success. 10,000,000 operations and 50 GB storage included.",
24-
price: 49,
25-
billingPeriod: "month",
26-
},
27-
{
28-
name: "Business",
29-
description: "For mission-critical apps. 50,000,000 operations and 100 GB storage included.",
30-
price: 129,
31-
billingPeriod: "month",
32-
},
33-
]);
34-
35-
export const metadata: Metadata = {
6+
export const metadata = createPageMetadata({
367
title: "Pricing — Prisma Postgres Plans & Features",
378
description:
38-
"Get started for free with Prisma Postgres. Choose the right plan for your workspace based on your project requirements.",
39-
alternates: {
40-
canonical: "https://www.prisma.io/pricing",
41-
},
42-
openGraph: {
43-
title: "Pricing — Prisma Postgres Plans & Features",
44-
description:
45-
"Get started for free with Prisma Postgres. Choose the right plan for your workspace based on your project requirements.",
46-
url: "https://www.prisma.io/pricing",
47-
images: [
48-
{
49-
url: "/og/og-pricing.png",
50-
},
51-
],
52-
},
53-
twitter: {
54-
card: "summary_large_image",
55-
title: "Pricing — Prisma Postgres Plans & Features",
56-
description:
57-
"Get started for free with Prisma Postgres. Choose the right plan for your workspace based on your project requirements.",
58-
images: ["/og/og-pricing.png"],
59-
},
60-
};
9+
"Get started for free with Prisma Postgres. Choose the right plan for your workspace based on your project requirements.",
10+
path: "/pricing",
11+
ogImage: "/og/og-pricing.png",
12+
});
6113

6214
export default function PricingPage() {
6315
return (
6416
<main className="flex-1 w-full -mt-24 bg-background-default text-background-neutral-weak pt-24">
65-
<JsonLd id="pricing-structured-data" data={pricingStructuredData} />
6617
<PricingPageContent />
6718

6819
{/* FAQ */}

apps/site/src/lib/structured-data.ts

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ type FaqEntry = {
66
answer: string;
77
};
88

9-
type PricingTier = {
10-
name: string;
11-
description: string;
12-
price: number;
13-
billingPeriod: string;
14-
};
15-
169
type ListEntry = {
1710
name: string;
1811
url: string;
@@ -90,55 +83,6 @@ export function createFaqStructuredData(pagePath: string, faqs: FaqEntry[], name
9083
};
9184
}
9285

93-
export function createPricingStructuredData(tiers: PricingTier[]) {
94-
const url = absoluteUrl("/pricing");
95-
const baseUrl = getBaseUrl();
96-
return {
97-
"@context": "https://schema.org",
98-
"@graph": [
99-
{
100-
"@type": "WebPage",
101-
"@id": `${url}#webpage`,
102-
name: "Prisma Pricing — Plans & Features",
103-
url,
104-
description:
105-
"Get started for free with Prisma Postgres. Choose the right plan for your workspace based on your project requirements.",
106-
publisher: {
107-
"@id": `${baseUrl}#organization`,
108-
},
109-
isPartOf: {
110-
"@id": `${baseUrl}#website`,
111-
},
112-
},
113-
...tiers.map((tier) => ({
114-
"@type": "Product",
115-
name: `Prisma Postgres ${tier.name}`,
116-
description: tier.description,
117-
brand: {
118-
"@id": `${baseUrl}#organization`,
119-
},
120-
offers: {
121-
"@type": "Offer",
122-
url,
123-
priceCurrency: "USD",
124-
price: tier.price,
125-
priceValidUntil: new Date(
126-
new Date().getFullYear() + 1,
127-
new Date().getMonth(),
128-
new Date().getDate(),
129-
)
130-
.toISOString()
131-
.split("T")[0],
132-
availability: "https://schema.org/InStock",
133-
...(tier.price > 0
134-
? { priceSpecification: { "@type": "UnitPriceSpecification", billingDuration: "P1M" } }
135-
: {}),
136-
},
137-
})),
138-
],
139-
};
140-
}
141-
14286
export function createSoftwareApplicationStructuredData({
14387
path,
14488
name,

0 commit comments

Comments
 (0)