{siteConfig('POST_TITLE_ICON') && (
@@ -72,7 +68,7 @@ const BlogItem = ({ post }) => {
{/* 图片封面 */}
{showPageCover && (
-
+
{archivePosts[archiveTitle].map(post => {
- const url = checkContainHttp(post.slug)
- ? sliceUrlFromHttp(post.slug)
- : `${siteConfig('SUB_PATH', '')}/${post.slug}`
-
return (
{post?.publishDay}
{post.title}
diff --git a/themes/example/components/Header.js b/themes/example/components/Header.js
index fdb049e3..5331eed2 100644
--- a/themes/example/components/Header.js
+++ b/themes/example/components/Header.js
@@ -8,7 +8,7 @@ import { MenuList } from './MenuList'
*/
export const Header = props => {
return (
-
+
{
onMouseOut={() => changeShow(false)}>
{!hasSubMenu && (
-
+
{link?.icon && } {link?.name}
{hasSubMenu && }
@@ -41,7 +41,7 @@ export const MenuItemDrop = ({ link }) => {
-
+
{link?.icon && }
{sLink.title}
diff --git a/themes/example/components/MenuList.js b/themes/example/components/MenuList.js
index 09613b1a..90b00c7e 100644
--- a/themes/example/components/MenuList.js
+++ b/themes/example/components/MenuList.js
@@ -17,28 +17,28 @@ export const MenuList = props => {
id: 1,
icon: 'fas fa-search',
name: locale.NAV.SEARCH,
- to: '/search',
+ href: '/search',
show: siteConfig('EXAMPLE_MENU_SEARCH', null, CONFIG)
},
{
id: 2,
icon: 'fas fa-archive',
name: locale.NAV.ARCHIVE,
- to: '/archive',
+ href: '/archive',
show: siteConfig('EXAMPLE_MENU_ARCHIVE', null, CONFIG)
},
{
id: 3,
icon: 'fas fa-folder',
name: locale.COMMON.CATEGORY,
- to: '/category',
+ href: '/category',
show: siteConfig('EXAMPLE_MENU_CATEGORY', null, CONFIG)
},
{
id: 4,
icon: 'fas fa-tag',
name: locale.COMMON.TAGS,
- to: '/tag',
+ href: '/tag',
show: siteConfig('EXAMPLE_MENU_TAG', null, CONFIG)
}
]
diff --git a/themes/fukasawa/components/BlogCard.js b/themes/fukasawa/components/BlogCard.js
index 6e31efac..7419dede 100644
--- a/themes/fukasawa/components/BlogCard.js
+++ b/themes/fukasawa/components/BlogCard.js
@@ -1,7 +1,6 @@
import LazyImage from '@/components/LazyImage'
import NotionIcon from '@/components/NotionIcon'
import { siteConfig } from '@/lib/config'
-import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
import Link from 'next/link'
import CONFIG from '../config'
import TagItemMini from './TagItemMini'
@@ -41,10 +40,6 @@ const BlogCard = ({ index, post, showSummary, siteInfo }) => {
}
: {}
- const url = checkContainHttp(post.slug)
- ? sliceUrlFromHttp(post.slug)
- : `${siteConfig('SUB_PATH', '')}/${post.slug}`
-
return (
{
{/* 封面图 */}
{showPageCover && (
-
+
{
- {siteConfig('POST_TITLE_ICON') && } {post.title}
+ {siteConfig('POST_TITLE_ICON') && (
+
+ )}{' '}
+ {post.title}
diff --git a/themes/fukasawa/components/BlogPostArchive.js b/themes/fukasawa/components/BlogPostArchive.js
index 300098d4..bcdafccf 100644
--- a/themes/fukasawa/components/BlogPostArchive.js
+++ b/themes/fukasawa/components/BlogPostArchive.js
@@ -1,6 +1,4 @@
import Link from 'next/link'
-import { siteConfig } from '@/lib/config'
-import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
/**
* 博客归档
@@ -16,31 +14,28 @@ const BlogArchiveItem = ({ posts = [], archiveTitle }) => {
return (
+ className='pt-16 pb-4 text-3xl dark:text-gray-300'
+ id={archiveTitle}>
{archiveTitle}
{posts?.map(post => {
- const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}`
- return -
-
- {post.date?.start_date}{' '}
-
-
-
- {post.title}
-
-
-
-
+ return (
+ -
+
+ {post.date?.start_date}{' '}
+
+
+ {post.title}
+
+
+
+ )
})}
diff --git a/themes/fukasawa/components/MenuItemCollapse.js b/themes/fukasawa/components/MenuItemCollapse.js
index 2d36242c..eb00850f 100644
--- a/themes/fukasawa/components/MenuItemCollapse.js
+++ b/themes/fukasawa/components/MenuItemCollapse.js
@@ -21,7 +21,7 @@ export const MenuItemCollapse = props => {
return null
}
- const selected = router.pathname === link.to || router.asPath === link.to
+ const selected = router.pathname === link.href || router.asPath === link.href
const toggleShow = () => {
changeShow(!show)
@@ -43,7 +43,7 @@ export const MenuItemCollapse = props => {
onClick={toggleShow}>
{!hasSubMenu && (
@@ -79,7 +79,7 @@ export const MenuItemCollapse = props => {
className='whitespace-nowrap dark:text-gray-200
not:last-child:border-b-0 border-b dark:border-gray-800 py-2 px-14 cursor-pointer hover:bg-gray-100
font-extralight dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'>
-
+
{
className='relative py-1 duration-500 justify-between text-gray-500 dark:text-gray-300 hover:text-black hover:underline cursor-pointer flex flex-nowrap items-center '>
{!hasSubMenu && (
@@ -47,7 +47,7 @@ export const MenuItemDrop = ({ link }) => {
return (
{sLink.icon && (
diff --git a/themes/fukasawa/components/MenuItemNormal.js b/themes/fukasawa/components/MenuItemNormal.js
index 5910babb..a4ccf59d 100644
--- a/themes/fukasawa/components/MenuItemNormal.js
+++ b/themes/fukasawa/components/MenuItemNormal.js
@@ -4,21 +4,23 @@ import { useRouter } from 'next/router'
export const MenuItemNormal = props => {
const { link } = props
const router = useRouter()
- const selected = (router.pathname === link.to) || (router.asPath === link.to)
+ const selected = router.pathname === link.href || router.asPath === link.href
if (!link || !link.show) {
return null
}
- return
-
-
- {link.name}
-
- {link.slot}
-
+ return (
+
+
+ {link.name}
+
+ {link.slot}
+ )
}
diff --git a/themes/fukasawa/components/MenuList.js b/themes/fukasawa/components/MenuList.js
index 6b5be406..33e7695b 100644
--- a/themes/fukasawa/components/MenuList.js
+++ b/themes/fukasawa/components/MenuList.js
@@ -1,19 +1,39 @@
+import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import CONFIG from '../config'
-import { siteConfig } from '@/lib/config'
-import { MenuItemDrop } from './MenuItemDrop'
import { MenuItemCollapse } from './MenuItemCollapse'
-
-export const MenuList = (props) => {
+import { MenuItemDrop } from './MenuItemDrop'
+/**
+ * 菜单列表
+ * @param {*} props
+ * @returns
+ */
+export const MenuList = props => {
const { customNav, customMenu } = props
const { locale } = useGlobal()
let links = [
- { name: locale.NAV.INDEX, to: '/' || '/', show: true },
- { name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('FUKASAWA_MENU_CATEGORY', null, CONFIG) },
- { name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('FUKASAWA_MENU_TAG', null, CONFIG) },
- { name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('FUKASAWA_MENU_ARCHIVE', null, CONFIG) },
- { name: locale.NAV.SEARCH, to: '/search', show: siteConfig('FUKASAWA_MENU_SEARCH', null, CONFIG) }
+ { name: locale.NAV.INDEX, href: '/' || '/', show: true },
+ {
+ name: locale.COMMON.CATEGORY,
+ href: '/category',
+ show: siteConfig('FUKASAWA_MENU_CATEGORY', null, CONFIG)
+ },
+ {
+ name: locale.COMMON.TAGS,
+ href: '/tag',
+ show: siteConfig('FUKASAWA_MENU_TAG', null, CONFIG)
+ },
+ {
+ name: locale.NAV.ARCHIVE,
+ href: '/archive',
+ show: siteConfig('FUKASAWA_MENU_ARCHIVE', null, CONFIG)
+ },
+ {
+ name: locale.NAV.SEARCH,
+ href: '/search',
+ show: siteConfig('FUKASAWA_MENU_SEARCH', null, CONFIG)
+ }
]
if (customNav) {
@@ -29,14 +49,22 @@ export const MenuList = (props) => {
return null
}
- return (<>
-
-
+ return (
+ <>
+
+
>
-
)
}
diff --git a/themes/game/components/BlogArchiveItem.js b/themes/game/components/BlogArchiveItem.js
index ac1c2522..4a92959e 100644
--- a/themes/game/components/BlogArchiveItem.js
+++ b/themes/game/components/BlogArchiveItem.js
@@ -1,6 +1,4 @@
-import { siteConfig } from '@/lib/config'
import Link from 'next/link'
-import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
/**
* 归档分组文章
@@ -9,36 +7,31 @@ import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
*/
export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
return (
-
-
- {archiveTitle}
-
+
+
+ {archiveTitle}
+
-
- {archivePosts[archiveTitle].map(post => {
- const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}`
-
- return -
-
-
- {post.date?.start_date}
- {' '}
-
-
-
- {post.title}
-
-
-
-
- })}
-
-
+
+ {archivePosts[archiveTitle].map(post => {
+ return (
+ -
+
+ {post.date?.start_date}{' '}
+
+
+ {post.title}
+
+
+
+ )
+ })}
+
+
)
}
diff --git a/themes/game/components/BlogPost.js b/themes/game/components/BlogPost.js
index fbe52fdf..0131dc62 100644
--- a/themes/game/components/BlogPost.js
+++ b/themes/game/components/BlogPost.js
@@ -1,40 +1,40 @@
-import Link from 'next/link'
-import { siteConfig } from '@/lib/config'
-import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
import NotionIcon from '@/components/NotionIcon'
import NotionPage from '@/components/NotionPage'
+import { siteConfig } from '@/lib/config'
+import Link from 'next/link'
const BlogPost = ({ post }) => {
- const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}`
-
const showPreview = siteConfig('POST_LIST_PREVIEW') && post.blockMap
return (
- (
-
-
-
-
- {siteConfig('POST_TITLE_ICON') && }{post.title}
+
+
+
+
+ {siteConfig('POST_TITLE_ICON') && (
+
+ )}
+ {post.title}
-
- {!showPreview &&
- {post.summary}
-
}
+ {!showPreview && (
+
+ {post.summary}
+
+ )}
{showPreview && post?.blockMap && (
-
+
-
+
)}
-
- )
+
)
}
diff --git a/themes/game/components/GameListIndexCombine.js b/themes/game/components/GameListIndexCombine.js
index 681efd27..ac8b14ba 100644
--- a/themes/game/components/GameListIndexCombine.js
+++ b/themes/game/components/GameListIndexCombine.js
@@ -2,7 +2,7 @@
import { AdSlot } from '@/components/GoogleAdsense'
import LazyImage from '@/components/LazyImage'
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'
import CONFIG from '../config'
@@ -139,14 +139,12 @@ const GameItem = ({ item, isLargeCard }) => {
const { title } = item
const img = item.pageCoverThumbnail
const [showType, setShowType] = useState('img') // img or video
- const url = checkContainHttp(item.slug)
- ? sliceUrlFromHttp(item.slug)
- : `${siteConfig('SUB_PATH', '')}/${item.slug}`
+
const video = item?.ext?.video
return (
{
diff --git a/themes/game/components/GameListNormal.js b/themes/game/components/GameListNormal.js
index b9bc9603..22fc4a6f 100644
--- a/themes/game/components/GameListNormal.js
+++ b/themes/game/components/GameListNormal.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,12 +42,11 @@ const GameItem = ({ item }) => {
const { title } = item
const img = item.pageCoverThumbnail
const [showType, setShowType] = useState('img') // img or video
- const url = checkContainHttp(item.slug) ? sliceUrlFromHttp(item.slug) : `${siteConfig('SUB_PATH', '')}/${item.slug}`
const video = item?.ext?.video
return (
{
setShowType('video')
}}
@@ -58,17 +56,27 @@ const GameItem = ({ item }) => {
title={title}
className={`card-single h-28 w-28 relative shadow rounded-md overflow-hidden flex justify-center items-center
group hover:border-purple-400`}>
- {title}
+
+ {title}
+
{showType === 'video' && (
-
- {siteConfig('POST_TITLE_ICON') && } {post.title}
+ {siteConfig('POST_TITLE_ICON') && (
+
+ )}{' '}
+ {post.title}
diff --git a/themes/fukasawa/components/BlogPostArchive.js b/themes/fukasawa/components/BlogPostArchive.js
index 300098d4..bcdafccf 100644
--- a/themes/fukasawa/components/BlogPostArchive.js
+++ b/themes/fukasawa/components/BlogPostArchive.js
@@ -1,6 +1,4 @@
import Link from 'next/link'
-import { siteConfig } from '@/lib/config'
-import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
/**
* 博客归档
@@ -16,31 +14,28 @@ const BlogArchiveItem = ({ posts = [], archiveTitle }) => {
return (
-
{posts?.map(post => {
- const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}`
- return
-
- - {post.date?.start_date}{' '} - - - - {post.title} - - --
+ return (
+
-
+ + {post.date?.start_date}{' '} + + + {post.title} + ++
+ )
})}
-
- {archivePosts[archiveTitle].map(post => {
- const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}`
-
- return
-
- - - {post.date?.start_date} - {' '} - - - - {post.title} - - --
- })}
-
-
+ {archivePosts[archiveTitle].map(post => {
+ return (
+
-
+ + {post.date?.start_date}{' '} + + + {post.title} + ++
+ )
+ })}
+
- {siteConfig('POST_TITLE_ICON') && }{post.title}
+
+
+
+
+ {siteConfig('POST_TITLE_ICON') && (
+
+ )}
+ {post.title}
-
- {!showPreview &&
- {post.summary}
-
}
+ {!showPreview && (
+
+ {post.summary}
+
+ )}
{showPreview && post?.blockMap && (
-
+
-
+
)}
-
- )
+
)
}
diff --git a/themes/game/components/GameListIndexCombine.js b/themes/game/components/GameListIndexCombine.js
index 681efd27..ac8b14ba 100644
--- a/themes/game/components/GameListIndexCombine.js
+++ b/themes/game/components/GameListIndexCombine.js
@@ -2,7 +2,7 @@
import { AdSlot } from '@/components/GoogleAdsense'
import LazyImage from '@/components/LazyImage'
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'
import CONFIG from '../config'
@@ -139,14 +139,12 @@ const GameItem = ({ item, isLargeCard }) => {
const { title } = item
const img = item.pageCoverThumbnail
const [showType, setShowType] = useState('img') // img or video
- const url = checkContainHttp(item.slug)
- ? sliceUrlFromHttp(item.slug)
- : `${siteConfig('SUB_PATH', '')}/${item.slug}`
+
const video = item?.ext?.video
return (
{
diff --git a/themes/game/components/GameListNormal.js b/themes/game/components/GameListNormal.js
index b9bc9603..22fc4a6f 100644
--- a/themes/game/components/GameListNormal.js
+++ b/themes/game/components/GameListNormal.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,12 +42,11 @@ const GameItem = ({ item }) => {
const { title } = item
const img = item.pageCoverThumbnail
const [showType, setShowType] = useState('img') // img or video
- const url = checkContainHttp(item.slug) ? sliceUrlFromHttp(item.slug) : `${siteConfig('SUB_PATH', '')}/${item.slug}`
const video = item?.ext?.video
return (
{
setShowType('video')
}}
@@ -58,17 +56,27 @@ const GameItem = ({ item }) => {
title={title}
className={`card-single h-28 w-28 relative shadow rounded-md overflow-hidden flex justify-center items-center
group hover:border-purple-400`}>
- {title}
+
+ {title}
+
{showType === 'video' && (
-
+ {siteConfig('POST_TITLE_ICON') && (
+
+ )}
+ {post.title}
- - {post.summary} -
} + {!showPreview && ( ++ {post.summary} +
+ )} {showPreview && post?.blockMap && ( -+