mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(blog) add CMS, render blog posts list
- use GitHub repo as cms, read idx.json - blog posts list
This commit is contained in:
7 files changed
+98
-2
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user