分类、标签

This commit is contained in:
tangly1024
2022-02-16 13:59:01 +08:00
parent 665b579767
commit 9d1e9b151f
8 changed files with 58 additions and 19 deletions

View File

@@ -6,6 +6,8 @@ import Link from 'next/link'
import React from 'react'
import { Code, Collection, Equation, NotionRenderer } from 'react-notion-x'
import CONFIG_MEDIUM from '../config_medium'
import CategoryItem from './CategoryItem'
import TagItemMini from './TagItemMini'
const BlogPostCard = ({ post, showSummary }) => {
const showPreview = CONFIG_MEDIUM.POST_LIST_PREVIEW && post.blockMap
@@ -20,8 +22,14 @@ const BlogPostCard = ({ post, showSummary }) => {
</a>
</Link>
<div className={'flex mt-2 items-center justify-start flex-wrap dark:text-gray-500 text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 '}>
{post.date.start_date}
<div className={'flex mt-2 items-center justify-start flex-wrap space-x-3 text-gray-400'}>
<div className='text-sm py-1'>{post.date.start_date}</div>
{ CONFIG_MEDIUM.POST_LIST_CATEGORY && <CategoryItem category={post.category}/>}
{ CONFIG_MEDIUM.POST_LIST_TAG && post?.tagItems?.map(tag => <TagItemMini key={tag.name} tag={tag} />)}
</div>
<div className='flex'>
</div>
{(!showPreview || showSummary) && <p className='my-4 text-gray-700 dark:text-gray-300 text-sm font-light leading-7'>