{配置兼容性}

This commit is contained in:
tangly1024
2024-06-15 10:34:55 +08:00
parent 2e983e4876
commit 19d9d896c4
5 changed files with 69 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
import { siteConfig } from '@/lib/config'
import { checkContainHttp } from '@/lib/utils'
import { checkStartWithHttp } from '@/lib/utils'
import Link from 'next/link'
import { useRouter } from 'next/router'
import NotionIcon from './NotionIcon'
@@ -23,7 +23,7 @@ const BlogPostCard = ({ post, className }) => {
return (
<Link
href={post?.href}
target={checkContainHttp(post.slug) ? '_blank' : '_self'}
target={checkStartWithHttp(post.slug) ? '_blank' : '_self'}
passHref>
<div
key={post.id}