From 8470dabf207052dbfb727834fa3b670fcbf676cd Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Fri, 23 Feb 2024 12:26:45 +0800 Subject: [PATCH] starter hotfix --- themes/starter/components/Blog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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} - +