diff --git a/themes/starter/components/Blog.js b/themes/starter/components/Blog.js index be245d17..168c2984 100644 --- a/themes/starter/components/Blog.js +++ b/themes/starter/components/Blog.js @@ -1,6 +1,8 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' import CONFIG from '../config' +import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' +import Link from 'next/link' /** * 博文列表 @@ -35,16 +37,17 @@ export const Blog = ({ posts }) => { {/* 博客列表 此处优先展示3片文章 */}
{posts?.map((item, index) => { + const url = checkContainHttp(item.slug) ? sliceUrlFromHttp(item.slug) : `${siteConfig('SUB_PATH', '')}/${item.slug}` return
- + {item.title} - +