import { getAllPosts } from '../lib/api' import Head from 'next/head' import { CMS_NAME } from '../lib/constants' import Post from '../types/post' type Props = { allPosts: Post[] } const Index = ({ allPosts }: Props) => { return ( <>
Test
> ) } export default Index export const getStaticProps = async () => { const allPosts = getAllPosts([ 'title', 'date', 'slug', 'author', 'excerpt', ]) return { props: { allPosts }, } }