diff --git a/themes/game/components/GameListRealate.js b/themes/game/components/GameListRealate.js index c432cb2e..3d925c3a 100644 --- a/themes/game/components/GameListRealate.js +++ b/themes/game/components/GameListRealate.js @@ -1,6 +1,5 @@ /* eslint-disable @next/next/no-img-element */ -import { siteConfig } from '@/lib/config' -import { checkContainHttp, deepClone, sliceUrlFromHttp } from '@/lib/utils' +import { deepClone } from '@/lib/utils' import Link from 'next/link' import { useState } from 'react' @@ -43,16 +42,12 @@ export const GameListRelate = ({ posts }) => { const GameItem = ({ item }) => { const { title } = item const [showType, setShowType] = useState('img') // img or video - const url = checkContainHttp(item.slug) - ? sliceUrlFromHttp(item.slug) - : `${siteConfig('SUB_PATH', '')}/${item.slug}` - const img = item?.pageCoverThumbnail const video = item?.ext?.video return ( { setShowType('video') }} diff --git a/themes/game/components/GameListRecent.js b/themes/game/components/GameListRecent.js index a68a61f1..e9156a9c 100644 --- a/themes/game/components/GameListRecent.js +++ b/themes/game/components/GameListRecent.js @@ -1,6 +1,5 @@ /* eslint-disable @next/next/no-img-element */ -import { siteConfig } from '@/lib/config' -import { checkContainHttp, deepClone, sliceUrlFromHttp } from '@/lib/utils' +import { deepClone } from '@/lib/utils' import { useRouter } from 'next/router' import { useState } from 'react' import { useGameGlobal } from '..' @@ -53,10 +52,6 @@ const GameItem = ({ item }) => { const { recentGames, setRecentGames } = useGameGlobal() const { title } = item || {} const [showType, setShowType] = useState('img') // img or video - const url = checkContainHttp(item.slug) - ? sliceUrlFromHttp(item.slug) - : `${siteConfig('SUB_PATH', '')}/${item.slug}` - const [isClockVisible, setClockVisible] = useState(true) const toggleIcons = () => { setClockVisible(!isClockVisible) @@ -77,7 +72,7 @@ const GameItem = ({ item }) => { } const handleButtonClick = () => { - router.push(url) // 如果是 Next.js + router.push(item?.href) // 如果是 Next.js } const img = item?.pageCoverThumbnail diff --git a/themes/starter/components/Blog.js b/themes/starter/components/Blog.js index 2dff9e82..ff056741 100644 --- a/themes/starter/components/Blog.js +++ b/themes/starter/components/Blog.js @@ -1,6 +1,5 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' -import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' import Link from 'next/link' import CONFIG from '../config' @@ -36,16 +35,13 @@ 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} {

{item.title} diff --git a/themes/starter/components/Footer.js b/themes/starter/components/Footer.js index 7bd6eafd..5bdc4a81 100644 --- a/themes/starter/components/Footer.js +++ b/themes/starter/components/Footer.js @@ -1,5 +1,4 @@ import { siteConfig } from '@/lib/config' -import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils' import SocialButton from '@/themes/fukasawa/components/SocialButton' import CONFIG from '../config' import { Logo } from './Logo' @@ -74,14 +73,10 @@ export const Footer = props => { {/* 展示两条最新博客文章 */}
{latestPosts?.map((item, index) => { - const url = checkContainHttp(item.slug) - ? sliceUrlFromHttp(item.slug) - : `${siteConfig('SUB_PATH', '')}/${item.slug}` - return (
{item.title}