Merge remote-tracking branch 'origin/main' into feat/merge
This commit is contained in:
@@ -6,7 +6,7 @@ import { getPostBySlug, getFeaturedImageUrl, getRelatedPosts } from "@/lib/wp-ap
|
||||
import { formatDateShamsi } from "@/lib/format-date";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import type { CollapseBlockPayload, BlockquoteBlockPayload, TipBlockPayload } from "@/lib/blog-blocks";
|
||||
import { parseContentHeadings, getReadingTimeMinutes } from "@/lib/blog-utils";
|
||||
import { parseContentHeadings, getReadingTimeMinutes, formatAuthorName } from "@/lib/blog-utils";
|
||||
import { BlogToc } from "@/components/blog-toc";
|
||||
import { BlogPostMeta } from "@/components/blog-post-meta";
|
||||
import { BlogCollapseSection } from "@/components/blog-collapse-section";
|
||||
@@ -71,7 +71,7 @@ export default async function BlogPostPage({ params }: BlogPostPageProps) {
|
||||
const modifiedDate = post.modified
|
||||
? formatDateShamsi(post.modified)
|
||||
: null;
|
||||
const authorName = post._embedded?.author?.[0]?.name ?? null;
|
||||
const authorName = formatAuthorName(post._embedded?.author?.[0]?.name);
|
||||
const thumbnailUrl = getFeaturedImageUrl(post, "full");
|
||||
const media = post._embedded?.["wp:featuredmedia"]?.[0];
|
||||
const altText = media?.alt_text || post.title?.rendered?.replace(/<[^>]*>/g, "") || "";
|
||||
@@ -94,6 +94,7 @@ export default async function BlogPostPage({ params }: BlogPostPageProps) {
|
||||
className="object-cover"
|
||||
quality={100}
|
||||
priority
|
||||
sizes="(max-width: 768px) 100vw, 1024px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -160,14 +161,14 @@ export default async function BlogPostPage({ params }: BlogPostPageProps) {
|
||||
</section>
|
||||
|
||||
{relatedPosts.length > 0 && (
|
||||
<section className="bg-muted border-t border-b">
|
||||
<div className="mx-auto max-w-6xl p-4">
|
||||
<h2 className="text-xl text-center mb-6 md:mb-8">
|
||||
<section className="bg-background border-t pb-16 md:pb-20">
|
||||
<div className="mx-auto max-w-6xl px-6 pt-10 md:pt-14">
|
||||
<h2 className="text-xl md:text-2xl text-center mb-8 md:mb-10">
|
||||
مقالات مرتبط
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 min-w-0">
|
||||
{relatedPosts.map((p) => (
|
||||
<BlogPostCard key={p.id} post={p} variant="tiny" />
|
||||
<BlogPostCard key={p.id} post={p} variant="related" />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -67,7 +67,7 @@ export default async function BlogPage({ searchParams }: BlogPageProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Hero + search & filters — compact */}
|
||||
{/* Hero + search & filters, compact */}
|
||||
<section className="bg-background pt-24 pb-6 md:pt-28 md:pb-8">
|
||||
<div className="mx-auto max-w-3xl px-4 sm:px-6">
|
||||
<div className="text-center space-y-5">
|
||||
@@ -98,7 +98,7 @@ export default async function BlogPage({ searchParams }: BlogPageProps) {
|
||||
aria-label="جستجو در مطالب"
|
||||
/>
|
||||
</div>
|
||||
<Button type="submit" size="default" className="h-9 px-4 shrink-0">
|
||||
<Button type="submit" className="shrink-0">
|
||||
جستجو
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user