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 let pageIcon = post.pageIcon !== '' ? post.pageIcon : siteConfig('IMG_LAZY_LOAD_PLACEHOLDER') pageIcon = post.pageIcon.indexOf('amazonaws.com') !== -1 ? post.pageIcon + '&width=88' : post.pageIcon return (

{post.title}

{post.summary ? post.summary : '暂无简介'}

) function removeHttp(str) { // 检查字符串是否包含http if (str.includes('http')) { // 如果包含,找到http的位置 const index = str.indexOf('http'); // 返回http之后的部分 return str.slice(index, str.length); } else { // 如果不包含,返回原字符串 return str; } } function checkRemoveHttp(str) { // 检查字符串是否包含http if (str.includes('http')) { // 如果包含,找到http的位置 return str.indexOf('http') > -1 } else { // 不包含 return false; } } } export default BlogPostCard