diff --git a/components/Sakura.js b/components/Sakura.js
index e814362f..7898b3cc 100644
--- a/components/Sakura.js
+++ b/components/Sakura.js
@@ -11,7 +11,7 @@ export const Sakura = () => {
useEffect(() => {
createSakura({})
- return () => destroyRibbon()
+ return () => destroySakura()
}, [])
return <>>
}
diff --git a/pages/[...slug].js b/pages/[...slug].js
index e14b98a2..c88570a7 100644
--- a/pages/[...slug].js
+++ b/pages/[...slug].js
@@ -49,7 +49,7 @@ const Slug = props => {
})
}
}
- }, 8 * 1000) // 404时长
+ }, 8 * 1000) // 404时长 8秒
const meta = { title: `${props?.siteInfo?.title || BLOG.TITLE} | loading`, image: siteInfo?.pageCover || BLOG.HOME_BANNER_IMAGE }
return
}
diff --git a/themes/hexo/components/DropMenu.js b/themes/hexo/components/DropMenu.js
new file mode 100644
index 00000000..bb508779
--- /dev/null
+++ b/themes/hexo/components/DropMenu.js
@@ -0,0 +1,67 @@
+import Link from 'next/link'
+import { useState } from 'react'
+
+export const DropMenu = ({ link }) => {
+ const [show, changeShow] = useState(false)
+ const hasSubMenu = link?.subMenus?.length > 0
+
+ return
changeShow(true)} onMouseOut={() => changeShow(false)} >
+
+ {!hasSubMenu &&
+
+ {link?.name}
+ {hasSubMenu &&
}
+ }
+
+ {hasSubMenu && <>
+
+ {link?.name}
+
+
+ >}
+
+ {/* 子菜单 */}
+ {hasSubMenu &&
+ {link.subMenus.map(sLink => {
+ return -
+
+ {sLink.title}
+
+
+ })}
+
}
+
+
+}
+
+//
+
+//
+//
+
+// return (
+//
+
+//
+// {link.slot}
+
+//
+// )
diff --git a/themes/hexo/components/MenuButtonGroupTop.js b/themes/hexo/components/MenuButtonGroupTop.js
index 866898e8..e38755b0 100644
--- a/themes/hexo/components/MenuButtonGroupTop.js
+++ b/themes/hexo/components/MenuButtonGroupTop.js
@@ -1,10 +1,11 @@
import React from 'react'
-import Link from 'next/link'
import { useGlobal } from '@/lib/global'
import CONFIG_HEXO from '../config_hexo'
+import { DropMenu } from './DropMenu'
+import BLOG from '@/blog.config'
const MenuButtonGroupTop = (props) => {
- const { customNav } = props
+ const { customNav, customMenu } = props
const { locale } = useGlobal()
let links = [
@@ -19,30 +20,15 @@ const MenuButtonGroupTop = (props) => {
links = links.concat(customNav)
}
+ // 如果 开启自定义菜单,则覆盖Page生成的菜单
+ if (BLOG.CUSTOM_MENU) {
+ links = customMenu
+ }
+
return (
-
+
)
}
export default MenuButtonGroupTop
diff --git a/themes/hexo/components/MenuList.js b/themes/hexo/components/MenuList.js
index e5579a6a..b3276bfb 100644
--- a/themes/hexo/components/MenuList.js
+++ b/themes/hexo/components/MenuList.js
@@ -1,11 +1,12 @@
import React from 'react'
-import Link from 'next/link'
import { useRouter } from 'next/router'
import { useGlobal } from '@/lib/global'
import CONFIG_HEXO from '../config_hexo'
+import BLOG from '@/blog.config'
+import { DropMenu } from './DropMenu'
const MenuList = (props) => {
- const { postCount, customNav } = props
+ const { postCount, customNav, customMenu } = props
const { locale } = useGlobal()
const router = useRouter()
const archiveSlot = {postCount}
@@ -21,32 +22,22 @@ const MenuList = (props) => {
links = links.concat(customNav)
}
+ // 如果 开启自定义菜单,则覆盖Page生成的菜单
+ if (BLOG.CUSTOM_MENU) {
+ links = customMenu
+ }
+
return (
- );
+ )
}
export default MenuList