You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
927 B
42 lines
927 B
import { type Metadata } from 'next/types';
|
|
import { allPosts, allInformatics } from 'contentlayer/generated';
|
|
import { compareDesc } from 'date-fns';
|
|
|
|
import { blogConfig } from '@/config';
|
|
import { PostPaginator } from '@/components/post-paginator';
|
|
|
|
const { url, title, description } = blogConfig.pages.posts;
|
|
|
|
const ogImage = {
|
|
url: `${blogConfig.url}/og?title=${title}`,
|
|
};
|
|
|
|
export const metadata: Metadata = {
|
|
title,
|
|
description,
|
|
openGraph: {
|
|
type: 'website',
|
|
url: `${blogConfig.url}${url}`,
|
|
title,
|
|
description,
|
|
images: [ogImage],
|
|
},
|
|
twitter: {
|
|
title,
|
|
description,
|
|
images: ogImage,
|
|
card: 'summary_large_image',
|
|
},
|
|
};
|
|
|
|
export default function PostsPage() {
|
|
const posts = allPosts.sort((a, b) =>
|
|
compareDesc(new Date(a.date), new Date(b.date)),
|
|
);
|
|
|
|
return (
|
|
<div className="h-full px-6 pb-12 sm:px-12">
|
|
<PostPaginator posts={posts} />
|
|
</div>
|
|
);
|
|
}
|
|
|