mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-02 23:16:51 +00:00
Nobelium主题
This commit is contained in:
29
themes/nobelium/components/BlogPost.js
Normal file
29
themes/nobelium/components/BlogPost.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import Link from 'next/link'
|
||||
import BLOG from '@/blog.config'
|
||||
import formatDate from '@/lib/formatDate'
|
||||
|
||||
const BlogPost = ({ post }) => {
|
||||
return (
|
||||
<Link href={`${BLOG.SUB_PATH}/${post.slug}`}>
|
||||
<a>
|
||||
<article key={post.id} className="mb-6 md:mb-8">
|
||||
<header className="flex flex-col justify-between md:flex-row md:items-baseline">
|
||||
<h2 className="text-lg md:text-xl font-medium mb-2 cursor-pointer text-black dark:text-gray-100">
|
||||
{post.title}
|
||||
</h2>
|
||||
<time className="flex-shrink-0 text-gray-600 dark:text-gray-400">
|
||||
{formatDate(post?.date?.start_date || post.createdTime, BLOG.LANG)}
|
||||
</time>
|
||||
</header>
|
||||
<main>
|
||||
<p className="hidden md:block leading-8 text-gray-700 dark:text-gray-300">
|
||||
{post.summary}
|
||||
</p>
|
||||
</main>
|
||||
</article>
|
||||
</a>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
export default BlogPost
|
||||
Reference in New Issue
Block a user