From 53cbee08410777927cd8856c70c43972087277ec Mon Sep 17 00:00:00 2001 From: AyrisAI Date: Mon, 13 Jul 2026 14:17:57 +0300 Subject: [PATCH] chore: clean up scratch files and apply remaining updates --- app/[locale]/[category]/[slug]/page.tsx | 63 +++++- app/[locale]/[category]/page.tsx | 27 +++ app/[locale]/about/page.tsx | 22 ++ app/[locale]/admin/blog/[id]/BlogPostForm.tsx | 171 +++++++++++++++ app/[locale]/admin/blog/[id]/page.tsx | 27 +-- .../admin/collections/[id]/CollectionForm.tsx | 207 +++++------------- app/[locale]/admin/collections/[id]/page.tsx | 20 +- app/[locale]/admin/collections/page.tsx | 11 +- app/[locale]/admin/messages/page.tsx | 13 +- app/[locale]/admin/submissions/page.tsx | 13 +- .../[id]/WidgetPartnerForm.tsx | 110 ++++++++++ .../admin/widget-partners/[id]/page.tsx | 36 +++ app/[locale]/blog/[slug]/page.tsx | 27 ++- app/[locale]/blog/page.tsx | 25 ++- app/[locale]/collection/[slug]/page.tsx | 21 +- app/[locale]/collections/page.tsx | 25 ++- app/[locale]/contact/page.tsx | 22 ++ app/[locale]/events/page.tsx | 22 ++ app/[locale]/layout.tsx | 52 ++++- app/[locale]/neighborhood/[slug]/page.tsx | 26 +++ app/[locale]/page.tsx | 41 ++-- app/sitemap.ts | 124 +++++++---- components/LiveSearchInput.tsx | 110 ++++++++++ components/Navbar.tsx | 4 +- lib/seo.ts | 45 ++++ messages/en.json | 2 +- messages/ru.json | 2 +- messages/tr.json | 2 +- 28 files changed, 986 insertions(+), 284 deletions(-) create mode 100644 app/[locale]/admin/blog/[id]/BlogPostForm.tsx create mode 100644 app/[locale]/admin/widget-partners/[id]/WidgetPartnerForm.tsx create mode 100644 app/[locale]/admin/widget-partners/[id]/page.tsx create mode 100644 components/LiveSearchInput.tsx create mode 100644 lib/seo.ts diff --git a/app/[locale]/[category]/[slug]/page.tsx b/app/[locale]/[category]/[slug]/page.tsx index 8f1f006..6ed46df 100644 --- a/app/[locale]/[category]/[slug]/page.tsx +++ b/app/[locale]/[category]/[slug]/page.tsx @@ -7,6 +7,8 @@ import { Link } from '@/i18n/routing' import { Phone, Globe, MapPin, Clock, Star, MessageSquare, Share2 } from 'lucide-react' import SaveButton from './SaveButton' import DetailTracker from './DetailTracker' +import type { Metadata } from 'next' +import { SITE_URL } from '@/lib/seo' interface DetailPageProps { params: Promise<{ locale: string; category: string; slug: string }> @@ -14,14 +16,32 @@ interface DetailPageProps { export const dynamic = 'force-dynamic' -export async function generateMetadata({ params }: DetailPageProps) { - const { slug } = await params +export async function generateMetadata({ params }: DetailPageProps): Promise { + const { locale, slug } = await params const listing = await mockDb.getListingBySlug(slug) if (!listing) return {} + const name = locale === 'ru' ? listing.nameRu : locale === 'en' ? listing.nameEn : listing.nameTr + const description = locale === 'ru' ? listing.descriptionRu : locale === 'en' ? listing.descriptionEn : listing.descriptionTr + const title = `${name} — Marmaris Local` + const image = listing.images?.[0]?.url + return { - title: `${listing.nameTr} — Marmaris Local`, - description: listing.descriptionTr + title, + description, + openGraph: { + title, + description, + url: `${SITE_URL}/${locale}/${listing.category?.slug || 'isletme'}/${listing.slug}`, + siteName: 'Marmaris Local', + type: 'website', + ...(image ? { images: [{ url: image }] } : {}), + }, + twitter: { + card: 'summary_large_image', + title, + description, + }, } } @@ -86,8 +106,43 @@ export default async function ListingDetailPage({ params }: DetailPageProps) { return `https://wa.me/?text=${text}` } + // schema.org LocalBusiness structured data + const schemaTypeByCategory: Record = { + restoran: 'Restaurant', + apart: 'LodgingBusiness', + isletme: 'LocalBusiness', + } + + const jsonLd = { + '@context': 'https://schema.org', + '@type': schemaTypeByCategory[categorySlug] || 'LocalBusiness', + name, + description, + image: listing.images?.map(img => img.url) || undefined, + url: `https://marmarislocal.com/${locale}/${categorySlug}/${listing.slug}`, + address: { + '@type': 'PostalAddress', + streetAddress: listing.address, + addressLocality: 'Marmaris', + addressCountry: 'TR', + }, + ...(listing.latitude && listing.longitude + ? { geo: { '@type': 'GeoCoordinates', latitude: listing.latitude, longitude: listing.longitude } } + : {}), + ...(listing.phone ? { telephone: listing.phone } : {}), + ...(listing.website ? { sameAs: [listing.website] } : {}), + priceRange: priceSymbols || undefined, + ...(listing.openingHours && (listing.openingHours as any).all + ? { openingHours: (listing.openingHours as any).all } + : {}), + } + return (
+