feat(blog) add CMS, render blog posts list

- use GitHub repo as cms, read idx.json
- blog posts list
This commit is contained in:
lumither committed 2024-04-27 12:03:08 +08:00
1 parent 7419e7e3cf
commit 603dbf71a6
7 files changed
+98 -2

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
import React from 'react';
import Link from 'next/link';
import { Card, CardBody, CardHeader } from '@nextui-org/card';
import { Divider } from '@nextui-org/react';
type Props = {
post: JSON
}
function BlogPostCard({ post }: Props) {
const name = (post as any)['name'];
const { title, desc } = (post as any)['meta'] as { title: string, desc: string };
return (
<div>
{/*todo: to be update*/ }
{/*<Link href={ `/blog/${ name }` }>*/}
<Card>
<CardHeader>
<p className={ 'font-bold' }>{ title }</p>
</CardHeader>
<Divider />
<CardBody>
{ desc }
</CardBody>
</Card>
{/*</Link>*/}
</div>
);
}
export default BlogPostCard;