import { url } from '@/app/layout.config'; import { articleSource } from '@/lib/source'; import type { Metadata } from 'next'; import Image from 'next/image'; import Link from 'next/link'; const title = 'Articles'; const description = 'Read our latest articles'; export const metadata: Metadata = { title, description, alternates: { canonical: url('/articles'), }, openGraph: { title, description, type: 'website', }, twitter: { card: 'summary_large_image', title, description, }, }; export default async function Page() { const articles = (await articleSource.getPages()).sort( (a, b) => b.data.date.getTime() - a.data.date.getTime(), ); return (

Articles

{articles.map((item) => ( {item.data.title} {item.data.tag && ( {item.data.tag} )}

{item.data.title}

{[item.data.team, item.data.date.toLocaleDateString()] .filter(Boolean) .join(' ยท ')}

))}
); }