diff --git a/blog/app/[[...page]]/page.tsx b/blog/app/[[...page]]/page.tsx index d9cbdb0..f48be2b 100644 --- a/blog/app/[[...page]]/page.tsx +++ b/blog/app/[[...page]]/page.tsx @@ -5,7 +5,7 @@ import { PageButtons } from '@/components/PageButtons'; import { BlogPostPreview } from '@/components/PostPreview'; import { getPostsMetadata } from '@/lib/get_posts'; import { createMetadata } from '@/lib/metadata'; -import { splitArray } from '@/lib/split_array'; +import { splitArray, splitArrayBiasFirst } from '@/lib/split_array'; const MAX_PER_PAGE = 6; @@ -60,9 +60,12 @@ export const generateMetadata = async ( const page = async ({ params }: PageProperties) => { const postsUnlimited = await getPostsMetadata(); - const pages = splitArray(postsUnlimited, MAX_PER_PAGE); + console.log(postsUnlimited.map((post) => post.date)); + + const pages = splitArrayBiasFirst(postsUnlimited, MAX_PER_PAGE); const currentPage = params.page ? Number.parseInt(params.page[0], 10) : 1; + const isHomePage = currentPage === 1; const posts = pages[currentPage - 1]; @@ -72,8 +75,18 @@ const page = async ({ params }: PageProperties) => { return (
-