feat: SEO overhaul — expanded sitemap, JSON-LD, canonical URLs, search metadata
This commit is contained in:
@@ -17,6 +17,7 @@ export async function generateMetadata({ params }: { params: Promise<{ slug: str
|
||||
return {
|
||||
title: `${device.name} — DeckyVault`,
|
||||
description: `Benchmark data and performance stats for ${device.name} on DeckyVault`,
|
||||
alternates: { canonical: `https://deckyvault.xyz/devices/${slug}` },
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,5 +38,18 @@ export default async function DevicePage({ params }: { params: Promise<{ slug: s
|
||||
notFound()
|
||||
}
|
||||
|
||||
return <DeviceDetailClient device={device} />
|
||||
const jsonLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Product",
|
||||
name: device.name,
|
||||
category: device.deviceType,
|
||||
url: `https://deckyvault.xyz/devices/${device.slug}`,
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} />
|
||||
<DeviceDetailClient device={device} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
+25
-4
@@ -1,10 +1,31 @@
|
||||
import { db } from "@/lib/db/index"
|
||||
import { hardware } from "@/lib/db/schema"
|
||||
import { DevicesPageClient } from "./page-client"
|
||||
|
||||
export const metadata = {
|
||||
title: "Devices — DeckyVault",
|
||||
description: "Browse handheld and console devices with benchmark data on DeckyVault",
|
||||
title: "Devices — DeckyVault",
|
||||
description: "Browse handheld and console devices with benchmark data on DeckyVault",
|
||||
alternates: { canonical: "https://deckyvault.xyz/devices" },
|
||||
}
|
||||
|
||||
export default function DevicesPage() {
|
||||
return <DevicesPageClient />
|
||||
export default async function DevicesPage() {
|
||||
const devices = await db.select({ slug: hardware.slug, name: hardware.name }).from(hardware)
|
||||
|
||||
const jsonLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "ItemList",
|
||||
itemListElement: devices.map((d, i) => ({
|
||||
"@type": "ListItem",
|
||||
position: i + 1,
|
||||
name: d.name,
|
||||
url: `https://deckyvault.xyz/devices/${d.slug}`,
|
||||
})),
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} />
|
||||
<DevicesPageClient />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user