import Link from 'next/link'; import Layout from '../../components/layout'; import date from '../../util/date'; import { getPostsMeta, PostMeta } from '../../util/slug'; function PostsPage({ postsMeta }: { postsMeta: PostMeta[] }) { return ( {postsMeta.map((post: PostMeta, i) => { return })}
Name Created on Last Updated
{post.title} {date.prettyPrint(new Date(post.created_at))} { post.last_updated ? date.prettyPrint(new Date(post.last_updated)) : '-' }
) } export async function getStaticProps() { return { props: { postsMeta: getPostsMeta() } }; } export default PostsPage;