Skip to content

Commit

Permalink
Merge pull request #1804 from ayonliu/deploy/afffans.com
Browse files Browse the repository at this point in the history
修复nav主题下category和tag下文章链接不对的bug
  • Loading branch information
tangly1024 authored Jan 30, 2024
2 parents 421d3c5 + 09c85d5 commit d149af4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion themes/nav/components/BlogPostCard.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import Link from 'next/link'
import NotionIcon from './NotionIcon'
import { useRouter } from 'next/router'
import { siteConfig } from '@/lib/config'

const BlogPostCard = ({ post, className }) => {
const router = useRouter()
const currentSelected = router.asPath.split('?')[0] === '/' + post.slug
const pageIcon = post.pageIcon.indexOf('amazonaws.com') !== -1 ? post.pageIcon + '&width=88' : post.pageIcon
return (
<Link href={`${removeHttp(post.slug)}`} target={(checkRemoveHttp(post.slug) ? '_blank' : '_self')} passHref>
<Link href={`${siteConfig('SUB_PATH', '')}/${removeHttp(post.slug)}`} target={(checkRemoveHttp(post.slug) ? '_blank' : '_self')} passHref>
<div key={post.id} className={`${className} h-full rounded-2xl p-4 dark:bg-neutral-800 cursor-pointer bg-white hover:bg-white dark:hover:bg-gray-800 ${currentSelected ? 'bg-green-50 text-green-500' : ''}`}>
<div className="stack-entry w-full flex space-x-3 select-none dark:text-neutral-200">
<NotionIcon icon={pageIcon} size='10' className='text-6xl w-11 h-11 mx-1 my-0 flex-none' />
Expand Down

0 comments on commit d149af4

Please sign in to comment.