fukasawa减少动画、并支持调整;

图片画质参数支持调节;
博客支持外链文章
This commit is contained in:
tangly1024.com
2024-02-01 15:25:07 +08:00
parent 66fc70e4f9
commit 022706bb40
43 changed files with 308 additions and 180 deletions

View File

@@ -2,6 +2,7 @@ import Link from 'next/link'
import NotionIcon from './NotionIcon'
import { useRouter } from 'next/router'
import { siteConfig } from '@/lib/config'
import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
const BlogPostCard = ({ post, className }) => {
const router = useRouter()
@@ -22,30 +23,6 @@ const BlogPostCard = ({ post, className }) => {
</div>
</Link>
)
// 检查连接是否是外链
function sliceUrlFromHttp(str) {
// 检查字符串是否包含http
if (str.includes('http')) {
// 如果包含找到http的位置
const index = str.indexOf('http');
// 返回http之后的部分
return str.slice(index, str.length);
} else {
// 如果不包含,返回原字符串
return str;
}
}
function checkContainHttp(str) {
// 检查字符串是否包含http
if (str.includes('http')) {
// 如果包含找到http的位置
return str.indexOf('http') > -1
} else {
// 不包含
return false;
}
}
}
export default BlogPostCard