feat: add featured posts grid and update blog terminology
- Introduced a new FeaturedPostsGrid component to display featured posts on the homepage. - Updated the Home component to fetch and render featured posts from the WordPress API. - Changed instances of "بلاگ" to "دانشنامه" across various components for consistent terminology.
This commit is contained in:
@@ -97,7 +97,7 @@ export default async function BlogPostPage({ params }: BlogPostPageProps) {
|
||||
className="text-muted-foreground hover:text-foreground text-sm inline-flex items-center gap-1 transition-colors"
|
||||
>
|
||||
<ChevronRight className="size-4" aria-hidden />
|
||||
بلاگ
|
||||
دانشنامه
|
||||
</Link>
|
||||
</nav>
|
||||
<h1
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import { ChevronRight, ChevronLeft, Search, X } from "lucide-react";
|
||||
const PER_PAGE = 9;
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "بلاگ",
|
||||
title: "دانشنامه",
|
||||
description: "مقالات و مطالب فیپ در زمینه یکپارچهسازی، اتوماسیون و بهرهوری سازمانی.",
|
||||
};
|
||||
|
||||
@@ -69,7 +69,7 @@ export default async function BlogPage({ searchParams }: BlogPageProps) {
|
||||
<div className="text-center space-y-5">
|
||||
<div className="space-y-1.5">
|
||||
<h1 className="text-3xl font-bold md:text-4xl tracking-tight">
|
||||
بلاگ
|
||||
دانشنامه
|
||||
</h1>
|
||||
<p className="text-sm md:text-base text-muted-foreground max-w-xl mx-auto">
|
||||
مقالات و مطالب فیپ در زمینه یکپارچهسازی، اتوماسیون و بهرهوری سازمانی.
|
||||
|
||||
+21
-2
@@ -1,14 +1,33 @@
|
||||
import ContentSection from "@/components/content-1";
|
||||
import Features from "@/components/features-12";
|
||||
import { FeaturedPostsGrid } from "@/components/featured-posts-grid";
|
||||
import { getPosts } from "@/lib/wp-api";
|
||||
import { HeroHeader } from "@/components/header";
|
||||
import HeroSection from "@/components/hero-section";
|
||||
import Image from "next/image";
|
||||
|
||||
export default function Home() {
|
||||
const FEATURED_CATEGORY_ID = 3;
|
||||
const FEATURED_POSTS_COUNT = 4;
|
||||
|
||||
export default async function Home() {
|
||||
let featuredPosts: Awaited<ReturnType<typeof getPosts>>["posts"] = [];
|
||||
try {
|
||||
const result = await getPosts({
|
||||
categoryId: FEATURED_CATEGORY_ID,
|
||||
perPage: FEATURED_POSTS_COUNT,
|
||||
orderby: "date",
|
||||
order: "desc",
|
||||
});
|
||||
featuredPosts = result.posts;
|
||||
} catch {
|
||||
// بدون پست هم صفحه رندر میشود
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<HeroSection />
|
||||
<Features />
|
||||
<ContentSection />
|
||||
<FeaturedPostsGrid posts={featuredPosts} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user