From 46b9ea1ba2b2c38499d1eb34043c92a4864ea5b4 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 6 Jul 2023 12:24:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=B8=BB=E9=A2=98=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/example/components/BlogListPage.js | 4 ++-- themes/example/components/BlogListScroll.js | 4 ++-- themes/example/components/BlogPostCard.js | 4 ++-- themes/example/components/Nav.js | 10 +++++----- .../example/{config_example.js => config.js} | 7 +++++-- themes/example/index.js | 4 ++-- themes/fukasawa/components/AsideLeft.js | 4 ++-- themes/fukasawa/components/BlogCard.js | 2 +- themes/fukasawa/components/MenuList.js | 2 +- themes/fukasawa/{config_fuka.js => config.js} | 4 ++-- themes/fukasawa/index.js | 8 ++++---- themes/gitbook/components/MenuBarMobile.js | 10 +++++----- themes/gitbook/components/TopNavBar.js | 10 +++++----- .../gitbook/{config_gitbook.js => config.js} | 4 ++-- themes/gitbook/index.js | 18 +++++++++--------- themes/hexo/components/ArticleAdjacent.js | 6 +++--- themes/hexo/components/ArticleCopyright.js | 4 ++-- themes/hexo/components/ArticleRecommend.js | 4 ++-- themes/hexo/components/BlogPostCard.js | 12 ++++++------ themes/hexo/components/BlogPostListScroll.js | 4 ++-- themes/hexo/components/FloatDarkModeButton.js | 4 ++-- themes/hexo/components/Header.js | 6 +++--- themes/hexo/components/JumpToCommentButton.js | 4 ++-- themes/hexo/components/JumpToTopButton.js | 4 ++-- themes/hexo/components/MenuGroupCard.js | 8 ++++---- themes/hexo/components/MenuListSide.js | 10 +++++----- themes/hexo/components/MenuListTop.js | 12 ++++++------ themes/hexo/components/SideRight.js | 6 +++--- themes/hexo/components/TocDrawerButton.js | 4 ++-- themes/hexo/{config_hexo.js => config.js} | 4 ++-- themes/hexo/index.js | 8 ++++---- 31 files changed, 99 insertions(+), 96 deletions(-) rename themes/example/{config_example.js => config.js} (76%) rename themes/fukasawa/{config_fuka.js => config.js} (90%) rename themes/gitbook/{config_gitbook.js => config.js} (88%) rename themes/hexo/{config_hexo.js => config.js} (97%) diff --git a/themes/example/components/BlogListPage.js b/themes/example/components/BlogListPage.js index be462516..429ee30e 100644 --- a/themes/example/components/BlogListPage.js +++ b/themes/example/components/BlogListPage.js @@ -3,7 +3,7 @@ import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' import { useRouter } from 'next/router' import Link from 'next/link' -import CONFIG_EXAMPLE from '../config_example' +import CONFIG from '../config' import BlogPostCard from './BlogPostCard' export const BlogListPage = props => { @@ -17,7 +17,7 @@ export const BlogListPage = props => { const showNext = page < totalPage const pagePrefix = router.asPath.split('?')[0].replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '') - const showPageCover = CONFIG_EXAMPLE.POST_LIST_COVER + const showPageCover = CONFIG.POST_LIST_COVER return (
diff --git a/themes/example/components/BlogListScroll.js b/themes/example/components/BlogListScroll.js index 1f0f302d..ad6df10e 100644 --- a/themes/example/components/BlogListScroll.js +++ b/themes/example/components/BlogListScroll.js @@ -3,7 +3,7 @@ import { useGlobal } from '@/lib/global' import React, { useEffect } from 'react' import throttle from 'lodash.throttle' import BlogPostCard from './BlogPostCard' -import CONFIG_EXAMPLE from '../config_example' +import CONFIG from '../config' export const BlogListScroll = props => { const { posts } = props @@ -35,7 +35,7 @@ export const BlogListScroll = props => { handleGetMore() } }, 500)) - const showPageCover = CONFIG_EXAMPLE.POST_LIST_COVER + const showPageCover = CONFIG.POST_LIST_COVER useEffect(() => { window.addEventListener('scroll', scrollTrigger) diff --git a/themes/example/components/BlogPostCard.js b/themes/example/components/BlogPostCard.js index fef41d60..03f38ec6 100644 --- a/themes/example/components/BlogPostCard.js +++ b/themes/example/components/BlogPostCard.js @@ -1,10 +1,10 @@ import BLOG from '@/blog.config' -import CONFIG_EXAMPLE from '../config_example' +import CONFIG from '../config' import Link from 'next/link' import TwikooCommentCount from '@/components/TwikooCommentCount' const BlogPostCard = ({ post }) => { - const showPageCover = CONFIG_EXAMPLE.POST_LIST_COVER && post?.pageCoverThumbnail + const showPageCover = CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail return
diff --git a/themes/example/components/Nav.js b/themes/example/components/Nav.js index f49a3ecb..c00dc8aa 100644 --- a/themes/example/components/Nav.js +++ b/themes/example/components/Nav.js @@ -1,6 +1,6 @@ import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' -import CONFIG_EXAMPLE from '../config_example' +import CONFIG from '../config' import { MenuItemDrop } from './MenuItemDrop' /** @@ -13,10 +13,10 @@ export const Nav = (props) => { const { locale } = useGlobal() let links = [ - { id: 1, icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_EXAMPLE.MENU_SEARCH }, - { id: 2, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_EXAMPLE.MENU_ARCHIVE }, - { id: 3, icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_EXAMPLE.MENU_CATEGORY }, - { id: 4, icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_EXAMPLE.MENU_TAG } + { id: 1, icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH }, + { id: 2, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE }, + { id: 3, icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY }, + { id: 4, icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG } ] if (customNav) { diff --git a/themes/example/config_example.js b/themes/example/config.js similarity index 76% rename from themes/example/config_example.js rename to themes/example/config.js index dd9427b7..27b8a34d 100644 --- a/themes/example/config_example.js +++ b/themes/example/config.js @@ -1,4 +1,7 @@ -const CONFIG_EXAMPLE = { +/** + * 主题配置文件 + */ +const CONFIG = { // 菜单配置 MENU_CATEGORY: true, // 显示分类 MENU_TAG: true, // 显示标签 @@ -8,4 +11,4 @@ const CONFIG_EXAMPLE = { POST_LIST_COVER: true // 列表显示文章封面 } -export default CONFIG_EXAMPLE +export default CONFIG diff --git a/themes/example/index.js b/themes/example/index.js index 9e627734..51986843 100644 --- a/themes/example/index.js +++ b/themes/example/index.js @@ -1,7 +1,7 @@ 'use client' import BLOG from '@/blog.config' -import CONFIG_EXAMPLE from './config_example' +import CONFIG from './config' import CommonHead from '@/components/CommonHead' import { useEffect } from 'react' import { Header } from './components/Header' @@ -244,7 +244,7 @@ const LayoutTagIndex = (props) => { } export { - CONFIG_EXAMPLE as THEME_CONFIG, + CONFIG as THEME_CONFIG, LayoutIndex, LayoutPostList, LayoutSearch, diff --git a/themes/fukasawa/components/AsideLeft.js b/themes/fukasawa/components/AsideLeft.js index 298bad3e..b2556556 100644 --- a/themes/fukasawa/components/AsideLeft.js +++ b/themes/fukasawa/components/AsideLeft.js @@ -10,7 +10,7 @@ import { useRouter } from 'next/router' import DarkModeButton from '@/components/DarkModeButton' import SocialButton from './SocialButton' import { useFukasawaGlobal } from '..' -import FUKA_CONFIG from '@/themes/fukasawa/config_fuka' +import CONFIG from '@/themes/fukasawa/config' // import { debounce } from 'lodash' // import { useEffect } from 'react' @@ -55,7 +55,7 @@ function AsideLeft(props) { return