gitbook 改版

This commit is contained in:
tangly1024.com
2024-09-24 11:39:18 +08:00
parent d94344c14a
commit fd4e96506b
13 changed files with 130 additions and 109 deletions

View File

@@ -3,7 +3,6 @@ import NotionIcon from '@/components/NotionIcon'
import { siteConfig } from '@/lib/config'
import Link from 'next/link'
import { useRouter } from 'next/router'
import CONFIG from '../config'
const BlogPostCard = ({ post, className }) => {
const router = useRouter()
@@ -14,8 +13,8 @@ const BlogPostCard = ({ post, className }) => {
<Link href={post?.href} passHref>
<div
key={post.id}
className={`${className} relative py-1.5 cursor-pointer px-1.5 hover:bg-gray-50 rounded-md dark:hover:bg-yellow-100 dark:hover:text-yellow-600
${currentSelected && 'bg-green-50 text-green-500 dark:bg-yellow-100 dark:text-yellow-600'}`}>
className={`${className} relative py-1.5 cursor-pointer px-1.5 rounded-md hover:bg-gray-50
${currentSelected ? 'text-green-500 dark:bg-yellow-100 dark:text-yellow-600 font-semibold' : ' dark:hover:bg-yellow-100 dark:hover:text-yellow-600'}`}>
<div className='w-full select-none'>
{siteConfig('POST_TITLE_ICON') && (
<NotionIcon icon={post?.pageIcon} />
@@ -23,10 +22,9 @@ const BlogPostCard = ({ post, className }) => {
{post.title}
</div>
{/* 最新文章加个红点 */}
{post?.isLatest &&
siteConfig('GITBOOK_LATEST_POST_RED_BADGE', false, CONFIG) && (
<Badge />
)}
{post?.isLatest && siteConfig('GITBOOK_LATEST_POST_RED_BADGE') && (
<Badge />
)}
</div>
</Link>
)