mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-06 12:57:44 +00:00
33 lines
490 B
TypeScript
33 lines
490 B
TypeScript
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 (
|
|
<>
|
|
<p>Test</p>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default Index
|
|
|
|
export const getStaticProps = async () => {
|
|
const allPosts = getAllPosts([
|
|
'title',
|
|
'date',
|
|
'slug',
|
|
'author',
|
|
'excerpt',
|
|
])
|
|
|
|
return {
|
|
props: { allPosts },
|
|
}
|
|
}
|