import type { Metadata } from "next"; import Image from "next/image"; import Link from "next/link"; import { notFound } from "next/navigation"; import Container from "@/components/Container"; import PageBanner from "@/components/PageBanner"; import PostCard from "@/components/PostCard"; import { getPost, getPosts, postContent, postDate, postExcerpt, postImage, postReadingTime, postTitle, } from "@/lib/meshkee"; export const revalidate = 300; export async function generateStaticParams() { const { items } = await getPosts({ page: 1, pageSize: 100 }); return items.map((p) => ({ slug: p.slug })); } export async function generateMetadata({ params, }: { params: Promise<{ slug: string }>; }): Promise { const { slug } = await params; const post = await getPost(slug); if (!post) return {}; return { title: `${postTitle(post)} | آراد آریسمان`, description: postExcerpt(post, 160), }; } export default async function BlogDetailPage({ params, }: { params: Promise<{ slug: string }>; }) { const { slug } = await params; const post = await getPost(slug); if (!post) notFound(); const title = postTitle(post); const image = postImage(post); const content = postContent(post); const related = post.categoryId ? (await getPosts({ categoryId: post.categoryId, pageSize: 4 })).items .filter((p) => p.id !== post.id) .slice(0, 3) : []; return ( <>
بازگشت به مقالات
{post.categoryNameFa && ( {post.categoryNameFa} )} {postDate(post)} {postReadingTime(post)}
{image && (
{title}
)} {content && (
)}

نویسنده: تیم آراد آریسمان

برای مشاوره تخصصی تغذیه دام و طیور با ما در تماس باشید.

تماس با ما
{related.length > 0 && (

مقالات مرتبط

{related.map((p) => ( ))}
)} ); }