import Head from 'next/head' import {Card} from '@/components/Card' import {SimpleLayout} from '@/components/SimpleLayout' import {getAllArticles} from '@/lib/getAllArticles' import {formatDate} from '@/lib/formatDate' function Article({article}) { return (
{article.title} {formatDate(article.date)} {article.description} Read article {formatDate(article.date)}
) } export default function ArticlesIndex({articles}) { return ( <> Writing - Ryan Freeman
{articles.map((article) => (
))}
) } export async function getStaticProps() { return { props: { articles: (await getAllArticles()).map(({component, ...meta}) => meta), }, } }