chore: clean up scratch files and apply remaining updates
This commit is contained in:
@@ -3,19 +3,36 @@ import { Link } from '@/i18n/routing'
|
||||
import { notFound } from 'next/navigation'
|
||||
import { Calendar, Tag, ArrowLeft } from 'lucide-react'
|
||||
import ListingCard from '@/components/ListingCard'
|
||||
import type { Metadata } from 'next'
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ locale: string; slug: string }>
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: Props) {
|
||||
const { slug } = await params
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { locale, slug } = await params
|
||||
const post = await mockDb.getBlogPostBySlug(slug)
|
||||
if (!post) return {}
|
||||
|
||||
|
||||
const title = locale === 'en' ? post.titleEn : locale === 'ru' ? post.titleRu : post.titleTr
|
||||
const content = locale === 'en' ? post.contentEn : locale === 'ru' ? post.contentRu : post.contentTr
|
||||
const description = content.substring(0, 150)
|
||||
const fullTitle = `${title} — Marmaris Local`
|
||||
|
||||
return {
|
||||
title: `${post.titleTr} — Marmaris Local`,
|
||||
description: post.contentTr.substring(0, 150)
|
||||
title: fullTitle,
|
||||
description,
|
||||
openGraph: {
|
||||
title: fullTitle,
|
||||
description,
|
||||
type: 'article',
|
||||
...(post.coverImage ? { images: [{ url: post.coverImage }] } : {}),
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
title: fullTitle,
|
||||
description,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,27 @@ import { mockDb } from '@/lib/mockDb'
|
||||
import { Link } from '@/i18n/routing'
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { Calendar, Tag } from 'lucide-react'
|
||||
import type { Metadata } from 'next'
|
||||
import { basicMetadata } from '@/lib/seo'
|
||||
|
||||
export async function generateMetadata() {
|
||||
return {
|
||||
title: 'Marmaris Local Blog — Yerel Lezzet ve Gezi Rehberi',
|
||||
description: 'Marmaris\'i bir yerel gibi keşfetmeniz için rehberler, nerede ne yenir tavsiyeleri ve gizli yerler.'
|
||||
}
|
||||
export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {
|
||||
const { locale } = await params
|
||||
|
||||
const title =
|
||||
locale === 'en'
|
||||
? 'Marmaris Local Blog — Local Food & Travel Guides'
|
||||
: locale === 'ru'
|
||||
? 'Блог Marmaris Local — Гид по еде и путешествиям'
|
||||
: 'Marmaris Local Blog — Yerel Lezzet ve Gezi Rehberi'
|
||||
|
||||
const description =
|
||||
locale === 'en'
|
||||
? 'Guides to explore Marmaris like a local — where to eat, hidden spots and travel tips.'
|
||||
: locale === 'ru'
|
||||
? 'Гиды, чтобы открыть Мармарис как местный житель — где поесть, скрытые места и советы путешественникам.'
|
||||
: "Marmaris'i bir yerel gibi keşfetmeniz için rehberler, nerede ne yenir tavsiyeleri ve gizli yerler."
|
||||
|
||||
return basicMetadata(title, description)
|
||||
}
|
||||
|
||||
export default async function BlogIndexPage({ params }: { params: Promise<{ locale: string }> }) {
|
||||
|
||||
Reference in New Issue
Block a user