Ship fonts, customer auth menu, contact API, and Meshkee SEO wiring.
Host Iran Yekan/Montserrat locally, link login to customer.havaran.com with a logged-in dropdown, submit contact forms to Meshkee, and publish sitemap-config with canonical id/slug detail URLs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
aaa3078145
commit
e4ca605e93
@@ -0,0 +1,64 @@
|
||||
import { notFound, permanentRedirect } from "next/navigation";
|
||||
import { Footer } from "@/components/Footer";
|
||||
import { Header } from "@/components/Header";
|
||||
import { PageHero } from "@/components/PageShared";
|
||||
import { ArticleDetailView } from "@/components/ArticleDetail";
|
||||
import { getBlogById } from "@/lib/meshkee";
|
||||
import { pageMetadata } from "@/lib/seo";
|
||||
import { blogPath, blogTitleSlug } from "@/lib/urls";
|
||||
|
||||
type PageProps = {
|
||||
params: Promise<{ id: string; slug: string }>;
|
||||
};
|
||||
|
||||
export async function generateMetadata({ params }: PageProps) {
|
||||
const { id } = await params;
|
||||
const { item } = await getBlogById(id);
|
||||
if (!item) {
|
||||
return pageMetadata({
|
||||
title: "مقاله",
|
||||
description: "مقاله مورد نظر یافت نشد.",
|
||||
path: `/articles/${id}`,
|
||||
noIndex: true,
|
||||
});
|
||||
}
|
||||
|
||||
const description = item.excerpt || item.title;
|
||||
return pageMetadata({
|
||||
title: item.title,
|
||||
description,
|
||||
path: blogPath(item),
|
||||
image: item.image || undefined,
|
||||
});
|
||||
}
|
||||
|
||||
export default async function ArticleDetailPage({ params }: PageProps) {
|
||||
const { id, slug: slugParam } = await params;
|
||||
const slug = decodeURIComponent(slugParam);
|
||||
const { item } = await getBlogById(id);
|
||||
if (!item) notFound();
|
||||
|
||||
const canonicalSlug = blogTitleSlug(item);
|
||||
if (slug !== canonicalSlug) {
|
||||
permanentRedirect(blogPath(item));
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Header />
|
||||
<main>
|
||||
<PageHero
|
||||
title={item.title}
|
||||
titleEn="ARTICLE"
|
||||
breadcrumb={[
|
||||
{ label: "صفحه اصلی", href: "/" },
|
||||
{ label: "مقالات", href: "/articles" },
|
||||
{ label: item.title, href: blogPath(item) },
|
||||
]}
|
||||
/>
|
||||
<ArticleDetailView item={item} />
|
||||
</main>
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user