import Link from 'next/link'; import Layout from '../../components/layout'; import date from '../../util/date'; import { getPostsMeta, PostMeta } from '../../util/slug'; function HomePage({ postsMeta }: { postsMeta: PostMeta[] }) { // todo: create a table-like user interface return ( // wow this is horrible
Post Name Created on Last Updated
{postsMeta.map((post: PostMeta, i) => { return
{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 HomePage;