import Link from '@/components/Link' import { PageSEO } from '@/components/SEO' import Tag from '@/components/Tag' import siteMetadata from '@/data/siteMetadata' import { getAllFilesFrontMatter } from '@/lib/mdx' import formatDate from '@/lib/utils/formatDate' import { GetStaticProps, InferGetStaticPropsType } from 'next' import { PostFrontMatter } from 'types/PostFrontMatter' import NewsletterForm from '@/components/NewsletterForm' const MAX_DISPLAY = 5 export const getStaticProps: GetStaticProps<{ posts: PostFrontMatter[] }> = async () => { const posts = await getAllFilesFrontMatter('blog') return { props: { posts } } } export default function Home({ posts }: InferGetStaticPropsType) { return ( <>

Latest

{siteMetadata.description}

    {!posts.length && 'No posts found.'} {posts.slice(0, MAX_DISPLAY).map((frontMatter) => { const { slug, date, title, summary, tags } = frontMatter return (
  • Published on

    {title}

    {tags.map((tag) => ( ))}
    {summary}
    Read more →
  • ) })}
{posts.length > MAX_DISPLAY && (
All Posts →
)} {siteMetadata.newsletter.provider !== '' && (
)} ) }