--- import { getCollection } from 'astro:content'; import BaseLayout from '@/layouts/BaseLayout.astro'; import Heading from '@/components/ui/Heading.astro'; import Search from '@/components/blog/Search.astro'; import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from '@/components/ui/pagination'; interface BlogPost { data: { title: string; description: string; }; slug: string; } export async function getStaticPaths({ paginate }: { paginate: Function }) { const allBlogposts = await getCollection('blog'); const postsPerPage = 4; return paginate(allBlogposts, { pageSize: postsPerPage, }); } const { page, }: { page: { data: BlogPost[]; url: { prev: string; current: string; next: string }; currentPage: number; lastPage: number; }; } = Astro.props; ---
Blog

Here are some blogposts, they are located in the repository as mdx files.


{ page.data.map((post) => (

{post.data.title}

{post.data.description}

Read more
)) }
{ page.currentPage > 1 && ( <> 1 ) } {page.currentPage} { page.currentPage < page.lastPage && ( <> {page.lastPage} ) }