- Rename /news route to /blog across all pages, links, and sitemap - Fix hardcoded English text in Experiences, QuoteSection, and Footer by wiring all content through the TR/EN dictionaries - Clean up Footer: remove non-existent page links, add contact column - Update contact info: new phone numbers, bilgi@ email, No:71 address, Instagram @ayrisapart link - Add suppressHydrationWarning to <body> to silence browser-extension attribute mismatch errors - Add sizes prop to all fill-mode Next.js Image components Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import { MetadataRoute } from 'next'
|
|
import { prisma } from '@/lib/prisma'
|
|
|
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
const baseUrl = 'https://ayrisapart.com'
|
|
const languages = ['tr', 'en']
|
|
|
|
// 1. Static Routes
|
|
const staticRoutes = [
|
|
'',
|
|
'/about',
|
|
'/suites',
|
|
'/blog',
|
|
'/contact',
|
|
]
|
|
|
|
const staticEntries: MetadataRoute.Sitemap = []
|
|
|
|
languages.forEach((lang) => {
|
|
staticRoutes.forEach((route) => {
|
|
staticEntries.push({
|
|
url: `${baseUrl}/${lang}${route}`,
|
|
lastModified: new Date(),
|
|
changeFrequency: 'weekly',
|
|
priority: route === '' ? 1 : 0.8,
|
|
})
|
|
})
|
|
})
|
|
|
|
// 2. Dynamic Suite Routes (8 mythological rooms)
|
|
const suites = ['iris', 'electra', 'arke', 'harpy', 'hydaspes', 'zephyrus', 'pothos', 'thaumas']
|
|
const suiteEntries: MetadataRoute.Sitemap = []
|
|
|
|
languages.forEach((lang) => {
|
|
suites.forEach((id) => {
|
|
suiteEntries.push({
|
|
url: `${baseUrl}/${lang}/suites/${id}`,
|
|
lastModified: new Date(),
|
|
changeFrequency: 'monthly',
|
|
priority: 0.7,
|
|
})
|
|
})
|
|
})
|
|
|
|
// 3. Dynamic News Routes (from Database)
|
|
const posts = await prisma.post.findMany({
|
|
where: { published: true },
|
|
select: { slug: true, lang: true, updatedAt: true }
|
|
})
|
|
|
|
const newsEntries: MetadataRoute.Sitemap = posts.map((post) => ({
|
|
url: `${baseUrl}/${post.lang}/blog/${post.slug}`,
|
|
lastModified: post.updatedAt,
|
|
changeFrequency: 'monthly',
|
|
priority: 0.6,
|
|
}))
|
|
|
|
return [...staticEntries, ...suiteEntries, ...newsEntries]
|
|
}
|