Files
blog-nextjs/app/page.tsx

33 lines
914 B
TypeScript

import Link from 'next/link';
import { getAllPostsSorted } from '@/lib/posts';
import { siteConfig } from '@/lib/config';
import { Hero } from '@/components/hero';
import { PostCard } from '@/components/post-card';
export default function HomePage() {
const posts = getAllPostsSorted().slice(0, siteConfig.postsPerPage);
return (
<section className="space-y-6">
<Hero />
<div>
<div className="mb-3 flex items-baseline justify-between">
<h2 className="text-xl font-semibold"></h2>
<Link
href="/blog"
className="text-sm text-blue-600 hover:underline dark:text-blue-400"
>
</Link>
</div>
<div className="space-y-4">
{posts.map((post) => (
<PostCard key={post._id} post={post} />
))}
</div>
</div>
</section>
);
}