use Next.js
This commit is contained in:
1 parent
cf94c66807
commit
20a00d5ab3
34 files changed
+7117
-1
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import PostQuery from '~/components/PostQuery'
|
||||
import { doSearch } from '~/server'
|
||||
import { IPost } from '~/server/db'
|
||||
import { GetStaticProps } from 'next'
|
||||
|
||||
const BlogPage = ({ count, result }: { count: number; result: IPost[] }) => {
|
||||
return (
|
||||
<PostQuery
|
||||
defaults={{
|
||||
posts: result,
|
||||
count
|
||||
}}
|
||||
></PostQuery>
|
||||
)
|
||||
}
|
||||
|
||||
export default BlogPage
|
||||
|
||||
export const getStaticProps: GetStaticProps = async () => {
|
||||
return {
|
||||
props: await doSearch({})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user