🪛 03 routing

This commit is contained in:
RJ
2025-11-07 16:55:58 +02:00
parent 651beb2de6
commit 05390016b2
8 changed files with 441 additions and 14 deletions

33
lib/seo.ts Normal file
View File

@@ -0,0 +1,33 @@
export interface SEOData {
title: string
description: string
url: string
image?: string
type?: 'website' | 'article'
author?: string
publishedTime?: string
}
export function generateStructuredData(data: SEOData) {
const structuredData: any = {
'@context': 'https://schema.org',
'@type': data.type === 'article' ? 'BlogPosting' : 'WebSite',
headline: data.title,
description: data.description,
url: data.url,
}
if (data.image) {
structuredData.image = data.image
}
if (data.type === 'article') {
structuredData.author = {
'@type': 'Person',
name: data.author || 'Unknown',
}
structuredData.datePublished = data.publishedTime
}
return JSON.stringify(structuredData)
}