+ {CONFIG.SIDEBAR_COLLAPSE_BUTTON &&
{isCollapsed ? : }
}
diff --git a/themes/fukasawa/components/BlogCard.js b/themes/fukasawa/components/BlogCard.js
index 482cb5b5..1513b6d0 100644
--- a/themes/fukasawa/components/BlogCard.js
+++ b/themes/fukasawa/components/BlogCard.js
@@ -2,7 +2,7 @@ import BLOG from '@/blog.config'
import Link from 'next/link'
import TagItemMini from './TagItemMini'
import React from 'react'
-import CONFIG_FUKA from '../config_fuka'
+import CONFIG_FUKA from '../config'
const BlogCard = ({ index, post, showSummary, siteInfo }) => {
const showPreview = CONFIG_FUKA.POST_LIST_PREVIEW && post.blockMap
diff --git a/themes/fukasawa/components/MenuList.js b/themes/fukasawa/components/MenuList.js
index af4f8c1b..d65e268d 100644
--- a/themes/fukasawa/components/MenuList.js
+++ b/themes/fukasawa/components/MenuList.js
@@ -1,5 +1,5 @@
import { useGlobal } from '@/lib/global'
-import CONFIG_FUKA from '../config_fuka'
+import CONFIG_FUKA from '../config'
import BLOG from '@/blog.config'
import { MenuItemDrop } from './MenuItemDrop'
import { MenuItemCollapse } from './MenuItemCollapse'
diff --git a/themes/fukasawa/config_fuka.js b/themes/fukasawa/config.js
similarity index 90%
rename from themes/fukasawa/config_fuka.js
rename to themes/fukasawa/config.js
index 1e9a2a2b..f9265e8c 100644
--- a/themes/fukasawa/config_fuka.js
+++ b/themes/fukasawa/config.js
@@ -1,4 +1,4 @@
-const FUKA_CONFIG = {
+const CONFIG = {
POST_LIST_COVER: true, // 文章列表显示图片封面
POST_LIST_COVER_FORCE: false, // 即使没有封面也将站点背景图设置为封面
@@ -14,4 +14,4 @@ const FUKA_CONFIG = {
SIDEBAR_COLLAPSE_SATUS_DEFAULT: false // 侧边栏默认折叠收起
}
-export default FUKA_CONFIG
+export default CONFIG
diff --git a/themes/fukasawa/index.js b/themes/fukasawa/index.js
index 5c05088e..90df9453 100644
--- a/themes/fukasawa/index.js
+++ b/themes/fukasawa/index.js
@@ -1,6 +1,6 @@
'use client'
-import FUKA_CONFIG from './config_fuka'
+import CONFIG from './config'
import CommonHead from '@/components/CommonHead'
import TopNav from './components/TopNav'
import AsideLeft from './components/AsideLeft'
@@ -46,9 +46,9 @@ const LayoutBase = (props) => {
// 侧边栏折叠从 本地存储中获取 open 状态的初始值
const [isCollapsed, setIsCollapse] = useState(() => {
if (typeof window !== 'undefined') {
- return localStorage.getItem('fukasawa-sidebar-collapse') === 'true' || FUKA_CONFIG.SIDEBAR_COLLAPSE_SATUS_DEFAULT
+ return localStorage.getItem('fukasawa-sidebar-collapse') === 'true' || CONFIG.SIDEBAR_COLLAPSE_SATUS_DEFAULT
}
- return FUKA_CONFIG.SIDEBAR_COLLAPSE_SATUS_DEFAULT
+ return CONFIG.SIDEBAR_COLLAPSE_SATUS_DEFAULT
})
// 在组件卸载时保存 open 状态到本地存储中
@@ -252,7 +252,7 @@ const LayoutTagIndex = (props) => {
}
export {
- FUKA_CONFIG as THEME_CONFIG,
+ CONFIG as THEME_CONFIG,
LayoutIndex,
LayoutSearch,
LayoutArchive,
diff --git a/themes/gitbook/components/MenuBarMobile.js b/themes/gitbook/components/MenuBarMobile.js
index 544598e0..d21fbfe5 100644
--- a/themes/gitbook/components/MenuBarMobile.js
+++ b/themes/gitbook/components/MenuBarMobile.js
@@ -1,6 +1,6 @@
import React from 'react'
import { useGlobal } from '@/lib/global'
-import CONFIG_GITBOOK from '../config_gitbook'
+import CONFIG from '../config'
import BLOG from '@/blog.config'
import { MenuItemCollapse } from './MenuItemCollapse'
@@ -10,10 +10,10 @@ export const MenuBarMobile = (props) => {
let links = [
// { name: locale.NAV.INDEX, to: '/' || '/', show: true },
- { name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_GITBOOK.MENU_CATEGORY },
- { name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_GITBOOK.MENU_TAG },
- { name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_GITBOOK.MENU_ARCHIVE }
- // { name: locale.NAV.SEARCH, to: '/search', show: CONFIG_GITBOOK.MENU_SEARCH }
+ { name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY },
+ { name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG },
+ { name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE }
+ // { name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH }
]
if (customNav) {
diff --git a/themes/gitbook/components/TopNavBar.js b/themes/gitbook/components/TopNavBar.js
index f0484e7d..09e14982 100644
--- a/themes/gitbook/components/TopNavBar.js
+++ b/themes/gitbook/components/TopNavBar.js
@@ -3,7 +3,7 @@ import { useRef, useState } from 'react'
import Collapse from '@/components/Collapse'
import { MenuBarMobile } from './MenuBarMobile'
import { useGlobal } from '@/lib/global'
-import CONFIG_GITBOOK from '../config_gitbook'
+import CONFIG from '../config'
import BLOG from '@/blog.config'
import { MenuItemDrop } from './MenuItemDrop'
import DarkModeButton from '@/components/DarkModeButton'
@@ -21,10 +21,10 @@ export default function TopNavBar(props) {
const { locale } = useGlobal()
const defaultLinks = [
- { icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_GITBOOK.MENU_CATEGORY },
- { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_GITBOOK.MENU_TAG },
- { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_GITBOOK.MENU_ARCHIVE },
- { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_GITBOOK.MENU_SEARCH }
+ { icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY },
+ { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG },
+ { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE },
+ { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH }
]
let links = defaultLinks.concat(customNav)
diff --git a/themes/gitbook/config_gitbook.js b/themes/gitbook/config.js
similarity index 88%
rename from themes/gitbook/config_gitbook.js
rename to themes/gitbook/config.js
index 2c563632..ce747181 100644
--- a/themes/gitbook/config_gitbook.js
+++ b/themes/gitbook/config.js
@@ -1,4 +1,4 @@
-const CONFIG_GITBOOK = {
+const CONFIG = {
INDEX_PAGE: 'about', // 文档首页显示的文章,请确此路径包含在您的notion数据库中
@@ -12,4 +12,4 @@ const CONFIG_GITBOOK = {
WIDGET_REVOLVER_MAPS: process.env.NEXT_PUBLIC_WIDGET_REVOLVER_MAPS || 'false', // 地图插件
WIDGET_TO_TOP: true // 跳回顶部
}
-export default CONFIG_GITBOOK
+export default CONFIG
diff --git a/themes/gitbook/index.js b/themes/gitbook/index.js
index 862fe1ca..0878dc0c 100644
--- a/themes/gitbook/index.js
+++ b/themes/gitbook/index.js
@@ -1,4 +1,4 @@
-import CONFIG_GITBOOK from './config_gitbook'
+import CONFIG from './config'
import { useRouter } from 'next/router'
import { useEffect, useState, createContext, useContext } from 'react'
import { isBrowser } from '@/lib/utils'
@@ -119,7 +119,7 @@ const LayoutBase = (props) => {
{slotRight}
{router.route === '/' && <>
- {CONFIG_GITBOOK.WIDGET_REVOLVER_MAPS === 'true' &&
}
+ {CONFIG.WIDGET_REVOLVER_MAPS === 'true' &&
}
>}
{/* gitbook主题首页只显示公告 */}
@@ -157,15 +157,15 @@ const LayoutBase = (props) => {
*/
const LayoutIndex = (props) => {
const router = useRouter()
- router.push(CONFIG_GITBOOK.INDEX_PAGE).then(() => {
- // console.log('跳转到指定首页', CONFIG_GITBOOK.INDEX_PAGE)
+ router.push(CONFIG.INDEX_PAGE).then(() => {
+ // console.log('跳转到指定首页', CONFIG.INDEX_PAGE)
setTimeout(() => {
if (isBrowser()) {
const article = document.getElementById('notion-article')
if (!article) {
- console.log('请检查您的Notion数据库中是否包含此slug页面: ', CONFIG_GITBOOK.INDEX_PAGE)
+ console.log('请检查您的Notion数据库中是否包含此slug页面: ', CONFIG.INDEX_PAGE)
const containerInner = document.getElementById('container-inner')
- const newHTML = `
配置有误
请在您的notion中添加一个slug为${CONFIG_GITBOOK.INDEX_PAGE}的文章
`
+ const newHTML = `
配置有误
请在您的notion中添加一个slug为${CONFIG.INDEX_PAGE}的文章
`
containerInner?.insertAdjacentHTML('afterbegin', newHTML)
}
}
@@ -214,9 +214,9 @@ const LayoutSlug = (props) => {
{/* 文章分类和标签信息 */}
- {CONFIG_GITBOOK.POST_DETAIL_CATEGORY && post?.category &&
}
+ {CONFIG.POST_DETAIL_CATEGORY && post?.category &&
}
- {CONFIG_GITBOOK.POST_DETAIL_TAG && post?.tagItems?.map(tag => )}
+ {CONFIG.POST_DETAIL_TAG && post?.tagItems?.map(tag => )}
@@ -277,7 +277,7 @@ const LayoutTagIndex = (props) => {
}
export {
- CONFIG_GITBOOK as THEME_CONFIG,
+ CONFIG as THEME_CONFIG,
LayoutIndex,
LayoutSearch,
LayoutArchive,
diff --git a/themes/hexo/components/ArticleAdjacent.js b/themes/hexo/components/ArticleAdjacent.js
index 3f4a929a..21ca9e32 100644
--- a/themes/hexo/components/ArticleAdjacent.js
+++ b/themes/hexo/components/ArticleAdjacent.js
@@ -1,5 +1,5 @@
import Link from 'next/link'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
/**
* 上一篇,下一篇文章
@@ -7,7 +7,7 @@ import CONFIG_HEXO from '../config_hexo'
* @returns
*/
export default function ArticleAdjacent ({ prev, next }) {
- if (!prev || !next || !CONFIG_HEXO.ARTICLE_ADJACENT) {
+ if (!prev || !next || !CONFIG.ARTICLE_ADJACENT) {
return <>>
}
return (
@@ -29,5 +29,5 @@ export default function ArticleAdjacent ({ prev, next }) {
- );
+ )
}
diff --git a/themes/hexo/components/ArticleCopyright.js b/themes/hexo/components/ArticleCopyright.js
index c1dc2dd7..4664573c 100644
--- a/themes/hexo/components/ArticleCopyright.js
+++ b/themes/hexo/components/ArticleCopyright.js
@@ -3,10 +3,10 @@ import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
export default function ArticleCopyright () {
- if (!CONFIG_HEXO.ARTICLE_COPYRIGHT) {
+ if (!CONFIG.ARTICLE_COPYRIGHT) {
return <>>
}
const router = useRouter()
diff --git a/themes/hexo/components/ArticleRecommend.js b/themes/hexo/components/ArticleRecommend.js
index 85b9de6d..e4943cf8 100644
--- a/themes/hexo/components/ArticleRecommend.js
+++ b/themes/hexo/components/ArticleRecommend.js
@@ -1,5 +1,5 @@
import Link from 'next/link'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
@@ -12,7 +12,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
const { locale } = useGlobal()
if (
- !CONFIG_HEXO.ARTICLE_RECOMMEND ||
+ !CONFIG.ARTICLE_RECOMMEND ||
!recommendPosts ||
recommendPosts.length === 0
) {
diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js
index 58741d31..648ce49e 100644
--- a/themes/hexo/components/BlogPostCard.js
+++ b/themes/hexo/components/BlogPostCard.js
@@ -1,21 +1,21 @@
import Link from 'next/link'
import React from 'react'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
import { BlogPostCardInfo } from './BlogPostCardInfo'
import BLOG from '@/blog.config'
// import Image from 'next/image'
const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
- const showPreview = CONFIG_HEXO.POST_LIST_PREVIEW && post.blockMap
- if (post && !post.pageCoverThumbnail && CONFIG_HEXO.POST_LIST_COVER_DEFAULT) {
+ const showPreview = CONFIG.POST_LIST_PREVIEW && post.blockMap
+ if (post && !post.pageCoverThumbnail && CONFIG.POST_LIST_COVER_DEFAULT) {
post.pageCover = siteInfo?.pageCoverThumbnail
}
- const showPageCover = CONFIG_HEXO.POST_LIST_COVER && post?.pageCoverThumbnail && !showPreview
+ const showPageCover = CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail && !showPreview
// const delay = (index % 2) * 200
return (
-
+
{
data-aos-anchor-placement="top-bottom"
id='blog-post-card'
key={post.id}
- className={`md:h-56 w-full flex justify-between md:flex-row flex-col-reverse ${CONFIG_HEXO.POST_LIST_IMG_CROSSOVER && index % 2 === 1 ? 'md:flex-row-reverse' : ''}
+ className={`md:h-56 w-full flex justify-between md:flex-row flex-col-reverse ${CONFIG.POST_LIST_IMG_CROSSOVER && index % 2 === 1 ? 'md:flex-row-reverse' : ''}
overflow-hidden border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray`}>
{/* 文字内容 */}
diff --git a/themes/hexo/components/BlogPostListScroll.js b/themes/hexo/components/BlogPostListScroll.js
index 2123700d..830e8177 100644
--- a/themes/hexo/components/BlogPostListScroll.js
+++ b/themes/hexo/components/BlogPostListScroll.js
@@ -3,7 +3,7 @@ import BlogPostCard from './BlogPostCard'
import BlogPostListEmpty from './BlogPostListEmpty'
import { useGlobal } from '@/lib/global'
import React from 'react'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
import { getListByPage } from '@/lib/utils'
/**
@@ -13,7 +13,7 @@ import { getListByPage } from '@/lib/utils'
* @returns {JSX.Element}
* @constructor
*/
-const BlogPostListScroll = ({ posts = [], currentSearch, showSummary = CONFIG_HEXO.POST_LIST_SUMMARY, siteInfo }) => {
+const BlogPostListScroll = ({ posts = [], currentSearch, showSummary = CONFIG.POST_LIST_SUMMARY, siteInfo }) => {
const postsPerPage = BLOG.POSTS_PER_PAGE
const [page, updatePage] = React.useState(1)
const postsToShow = getListByPage(posts, page, postsPerPage)
diff --git a/themes/hexo/components/FloatDarkModeButton.js b/themes/hexo/components/FloatDarkModeButton.js
index dcae5ac7..f693d1f0 100644
--- a/themes/hexo/components/FloatDarkModeButton.js
+++ b/themes/hexo/components/FloatDarkModeButton.js
@@ -1,11 +1,11 @@
import { useGlobal } from '@/lib/global'
import { saveDarkModeToCookies } from '@/themes/theme'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
export default function FloatDarkModeButton () {
const { isDarkMode, updateDarkMode } = useGlobal()
- if (!CONFIG_HEXO.WIDGET_DARK_MODE) {
+ if (!CONFIG.WIDGET_DARK_MODE) {
return <>>
}
diff --git a/themes/hexo/components/Header.js b/themes/hexo/components/Header.js
index 1f614b55..f64263ab 100644
--- a/themes/hexo/components/Header.js
+++ b/themes/hexo/components/Header.js
@@ -1,7 +1,7 @@
// import Image from 'next/image'
import { useEffect, useState } from 'react'
import Typed from 'typed.js'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
import NavButtonGroup from './NavButtonGroup'
import { useGlobal } from '@/lib/global'
import BLOG from '@/blog.config'
@@ -63,7 +63,7 @@ const Hero = props => {
{/* 首页导航大按钮 */}
- {CONFIG_HEXO.HOME_NAV_BUTTONS &&
}
+ {CONFIG.HOME_NAV_BUTTONS &&
}
{/* 滚动按钮 */}
@@ -73,7 +73,7 @@ const Hero = props => {
+ className={`header-cover bg-center w-full h-screen bg-cover ${CONFIG.HOME_NAV_BACKGROUND_IMG_FIXED ? 'bg-fixed' : ''}`} />
)
diff --git a/themes/hexo/components/JumpToCommentButton.js b/themes/hexo/components/JumpToCommentButton.js
index ce82883e..fb007712 100644
--- a/themes/hexo/components/JumpToCommentButton.js
+++ b/themes/hexo/components/JumpToCommentButton.js
@@ -1,5 +1,5 @@
import React from 'react'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
/**
* 跳转到评论区
@@ -7,7 +7,7 @@ import CONFIG_HEXO from '../config_hexo'
* @constructor
*/
const JumpToCommentButton = () => {
- if (!CONFIG_HEXO.WIDGET_TO_COMMENT) {
+ if (!CONFIG.WIDGET_TO_COMMENT) {
return <>>
}
diff --git a/themes/hexo/components/JumpToTopButton.js b/themes/hexo/components/JumpToTopButton.js
index 3602ad99..77313f46 100644
--- a/themes/hexo/components/JumpToTopButton.js
+++ b/themes/hexo/components/JumpToTopButton.js
@@ -1,6 +1,6 @@
import { useGlobal } from '@/lib/global'
import React from 'react'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
/**
* 跳转到网页顶部
@@ -13,7 +13,7 @@ import CONFIG_HEXO from '../config_hexo'
const JumpToTopButton = ({ showPercent = true, percent }) => {
const { locale } = useGlobal()
- if (!CONFIG_HEXO.WIDGET_TO_TOP) {
+ if (!CONFIG.WIDGET_TO_TOP) {
return <>>
}
return (
window.scrollTo({ top: 0, behavior: 'smooth' })} >
diff --git a/themes/hexo/components/MenuGroupCard.js b/themes/hexo/components/MenuGroupCard.js
index e481c2e6..25dba50c 100644
--- a/themes/hexo/components/MenuGroupCard.js
+++ b/themes/hexo/components/MenuGroupCard.js
@@ -1,7 +1,7 @@
import React from 'react'
import Link from 'next/link'
import { useGlobal } from '@/lib/global'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
const MenuGroupCard = (props) => {
const { postCount, categoryOptions, tagOptions } = props
@@ -11,9 +11,9 @@ const MenuGroupCard = (props) => {
const tagSlot =
{tagOptions?.length}
const links = [
- { name: locale.COMMON.ARTICLE, to: '/archive', slot: archiveSlot, show: CONFIG_HEXO.MENU_ARCHIVE },
- { name: locale.COMMON.CATEGORY, to: '/category', slot: categorySlot, show: CONFIG_HEXO.MENU_CATEGORY },
- { name: locale.COMMON.TAGS, to: '/tag', slot: tagSlot, show: CONFIG_HEXO.MENU_TAG }
+ { name: locale.COMMON.ARTICLE, to: '/archive', slot: archiveSlot, show: CONFIG.MENU_ARCHIVE },
+ { name: locale.COMMON.CATEGORY, to: '/category', slot: categorySlot, show: CONFIG.MENU_CATEGORY },
+ { name: locale.COMMON.TAGS, to: '/tag', slot: tagSlot, show: CONFIG.MENU_TAG }
]
return (
diff --git a/themes/hexo/components/MenuListSide.js b/themes/hexo/components/MenuListSide.js
index cda25159..1a3b2f5b 100644
--- a/themes/hexo/components/MenuListSide.js
+++ b/themes/hexo/components/MenuListSide.js
@@ -2,17 +2,17 @@ import React from 'react'
import { useGlobal } from '@/lib/global'
import BLOG from '@/blog.config'
import { MenuItemCollapse } from './MenuItemCollapse'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
export const MenuListSide = (props) => {
const { customNav, customMenu } = props
const { locale } = useGlobal()
let links = [
- { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_HEXO.MENU_ARCHIVE },
- { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_HEXO.MENU_SEARCH },
- { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_HEXO.MENU_CATEGORY },
- { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_HEXO.MENU_TAG }
+ { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE },
+ { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH },
+ { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY },
+ { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG }
]
if (customNav) {
diff --git a/themes/hexo/components/MenuListTop.js b/themes/hexo/components/MenuListTop.js
index ff40d24e..a2fd66ad 100644
--- a/themes/hexo/components/MenuListTop.js
+++ b/themes/hexo/components/MenuListTop.js
@@ -1,6 +1,6 @@
import React from 'react'
import { useGlobal } from '@/lib/global'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
import BLOG from '@/blog.config'
import { MenuItemDrop } from './MenuItemDrop'
@@ -9,11 +9,11 @@ export const MenuListTop = (props) => {
const { locale } = useGlobal()
let links = [
- { id: 1, icon: 'fa-solid fa-house', name: locale.NAV.INDEX, to: '/', show: CONFIG_HEXO.MENU_INDEX },
- { id: 2, icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_HEXO.MENU_SEARCH },
- { id: 3, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_HEXO.MENU_ARCHIVE }
- // { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_HEXO.MENU_CATEGORY },
- // { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_HEXO.MENU_TAG }
+ { id: 1, icon: 'fa-solid fa-house', name: locale.NAV.INDEX, to: '/', show: CONFIG.MENU_INDEX },
+ { id: 2, icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH },
+ { id: 3, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE }
+ // { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY },
+ // { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG }
]
if (customNav) {
diff --git a/themes/hexo/components/SideRight.js b/themes/hexo/components/SideRight.js
index 15f5bc4f..570bf32f 100644
--- a/themes/hexo/components/SideRight.js
+++ b/themes/hexo/components/SideRight.js
@@ -5,7 +5,7 @@ import TagGroups from './TagGroups'
import Catalog from './Catalog'
import { InfoCard } from './InfoCard'
import { AnalyticsCard } from './AnalyticsCard'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
import BLOG from '@/blog.config'
import dynamic from 'next/dynamic'
import Announcement from './Announcement'
@@ -41,7 +41,7 @@ export default function SideRight(props) {
return (
- {CONFIG_HEXO.WIDGET_ANALYTICS &&
}
+ {CONFIG.WIDGET_ANALYTICS &&
}
{showCategory && (
@@ -59,7 +59,7 @@ export default function SideRight(props) {
)}
- {CONFIG_HEXO.WIDGET_LATEST_POSTS && latestPosts && latestPosts.length > 0 &&
+ {CONFIG.WIDGET_LATEST_POSTS && latestPosts && latestPosts.length > 0 &&
}
diff --git a/themes/hexo/components/TocDrawerButton.js b/themes/hexo/components/TocDrawerButton.js
index fc87cefc..8e5053b6 100644
--- a/themes/hexo/components/TocDrawerButton.js
+++ b/themes/hexo/components/TocDrawerButton.js
@@ -1,6 +1,6 @@
import { useGlobal } from '@/lib/global'
import React from 'react'
-import CONFIG_HEXO from '../config_hexo'
+import CONFIG from '../config'
/**
* 点击召唤目录抽屉
@@ -11,7 +11,7 @@ import CONFIG_HEXO from '../config_hexo'
*/
const TocDrawerButton = (props) => {
const { locale } = useGlobal()
- if (!CONFIG_HEXO.WIDGET_TOC) {
+ if (!CONFIG.WIDGET_TOC) {
return <>>
}
return (
diff --git a/themes/hexo/config_hexo.js b/themes/hexo/config.js
similarity index 97%
rename from themes/hexo/config_hexo.js
rename to themes/hexo/config.js
index 5551210e..b24d4fd1 100644
--- a/themes/hexo/config_hexo.js
+++ b/themes/hexo/config.js
@@ -1,4 +1,4 @@
-const CONFIG_HEXO = {
+const CONFIG = {
HOME_BANNER_ENABLE: true,
// 3.14.1以后的版本中,欢迎语在blog.config.js中配置,用英文逗号','隔开多个。
HOME_BANNER_GREETINGS: ['Hi,我是一个程序员', 'Hi,我是一个打工人', 'Hi,我是一个干饭人', '欢迎来到我的博客🎉'], // 首页大图标语文字
@@ -33,4 +33,4 @@ const CONFIG_HEXO = {
WIDGET_DARK_MODE: true, // 夜间模式
WIDGET_TOC: true // 移动端悬浮目录
}
-export default CONFIG_HEXO
+export default CONFIG
diff --git a/themes/hexo/index.js b/themes/hexo/index.js
index cca4f226..98095ee1 100644
--- a/themes/hexo/index.js
+++ b/themes/hexo/index.js
@@ -1,4 +1,4 @@
-import CONFIG_HEXO from './config_hexo'
+import CONFIG from './config'
import CommonHead from '@/components/CommonHead'
import { useEffect, useRef } from 'react'
@@ -72,7 +72,7 @@ const LayoutBase = props => {
{/* 主区块 */}
-
+
@@ -115,7 +115,7 @@ const LayoutBase = props => {
* @returns
*/
const LayoutIndex = (props) => {
- const headerSlot = CONFIG_HEXO.HOME_BANNER_ENABLE &&
+ const headerSlot = CONFIG.HOME_BANNER_ENABLE &&
return
}
@@ -352,7 +352,7 @@ const LayoutTagIndex = props => {
}
export {
- CONFIG_HEXO as THEME_CONFIG,
+ CONFIG as THEME_CONFIG,
LayoutIndex,
LayoutSearch,
LayoutArchive,