--- import { getCollection } from "astro:content"; import { CATEGORIES } from "@/content/config"; import Header from "@/components/Header.astro"; import Footer from "@/components/Footer.astro"; import Layout from "@/layouts/Layout.astro"; import Post from "@/components/Post.astro"; export async function getStaticPaths({ paginate }: { paginate: any }) { const blogEntries = await getCollection("blog"); return CATEGORIES.flatMap((category) => { const filteredPosts = blogEntries.filter( (post) => post.data.category == category, ); return paginate(filteredPosts, { params: { category }, pageSize: 3, }); }); } const { page } = Astro.props; const posts = page.data as Array; const pages = Array.from({ length: page.lastPage }, (_, i) => i + 1); ---
{ posts.length > 0 ? ( posts .sort((p1, p2) => p2.data.date.getTime() - p1.data.date.getTime()) .map((p) => ) ) : (

Henüz bu kategoride bir yazı yayınlanmadı. Yazarımızın ilhama veya teşviğe ihtiyacı olabilir!

) }
{ page.lastPage != 1 && ( <>
{pages.map((pageNumber) => { switch (pageNumber) { case page.currentPage: return {pageNumber}; default: return ( {pageNumber} ); } })}
) }