import { getAllPostsMeta } from '@/lib/posts' import { Post } from '@/components/common/Post' import Link from 'next/link' export default function BlogIndex() { const posts = getAllPostsMeta() const rest = posts.slice(1) const rows = [] for (let i = 0; i < rest.length; i += 2) { rows.push(rest.slice(i, i + 2)) } return ( <>
{posts.length === 0 ? (
No published posts yet.
) : ( <>
{rows.map((row) => { const rowHasImage = row.some((p) => p.coverImage) return (
{row.map((post) => ( ))}
) })}
)}
) }