import BLOG from '@/blog.config' import Link from 'next/link' import NotionIcon from './NotionIcon' import { useRouter } from 'next/router' import React from 'react' 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 (

{post.title}

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

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