From aa1ad6e371fad9e37ba4c03c26da184530a5cb9c Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 6 Jul 2023 12:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/landing/components/Newsletter.js | 2 +- themes/matery/components/ArticleAdjacent.js | 4 ++-- themes/matery/components/ArticleCopyright.js | 4 ++-- themes/matery/components/ArticleRecommend.js | 4 ++-- themes/matery/components/BlogPostCard.js | 6 +++--- themes/matery/components/BlogPostListScroll.js | 4 ++-- themes/matery/components/FloatDarkModeButton.js | 4 ++-- themes/matery/components/Hero.js | 4 ++-- themes/matery/components/JumpToCommentButton.js | 4 ++-- themes/matery/components/JumpToTopButton.js | 4 ++-- themes/matery/components/MenuGroupCard.js | 8 ++++---- themes/matery/components/MenuList.js | 10 +++++----- themes/matery/components/MenuListSide.js | 10 +++++----- themes/matery/components/MenuListTop.js | 10 +++++----- themes/matery/components/SideRight.js | 6 +++--- themes/matery/components/TocDrawerButton.js | 4 ++-- themes/matery/{config_matery.js => config.js} | 4 ++-- themes/matery/index.js | 8 ++++---- themes/medium/components/BlogPostCard.js | 10 +++++----- themes/medium/components/JumpToTopButton.js | 4 ++-- themes/medium/components/MenuBarMobile.js | 10 +++++----- themes/medium/components/TopNavBar.js | 10 +++++----- themes/medium/{config_medium.js => config.js} | 4 ++-- themes/medium/index.js | 12 ++++++------ themes/next/components/ArticleCopyright.js | 8 ++++---- themes/next/components/ArticleDetail.js | 6 +++--- themes/next/components/BlogPostCard.js | 6 +++--- themes/next/components/BlogPostListScroll.js | 4 ++-- themes/next/components/FloatDarkModeButton.js | 4 ++-- themes/next/components/Header.js | 4 ++-- themes/next/components/JumpToBottomButton.js | 4 ++-- themes/next/components/JumpToTopButton.js | 4 ++-- themes/next/components/MenuList.js | 8 ++++---- themes/next/components/RecommendPosts.js | 4 ++-- themes/next/components/SideAreaLeft.js | 4 ++-- themes/next/components/SideAreaRight.js | 10 +++++----- themes/next/components/StickyBar.js | 4 ++-- themes/next/components/TocDrawerButton.js | 4 ++-- themes/next/components/TopNav.js | 8 ++++---- themes/next/{config_next.js => config.js} | 4 ++-- themes/next/index.js | 10 +++++----- themes/nobelium/components/Nav.js | 14 +++++++------- themes/nobelium/{config_nobelium.js => config.js} | 4 ++-- themes/nobelium/index.js | 4 ++-- themes/simple/components/ArticleInfo.js | 4 ++-- themes/simple/components/BlogItem.js | 4 ++-- themes/simple/components/Header.js | 8 ++++---- themes/simple/components/MenuList.js | 10 +++++----- themes/simple/components/TopBar.js | 6 +++--- themes/simple/{config_simple.js => config.js} | 4 ++-- themes/simple/index.js | 6 +++--- 51 files changed, 155 insertions(+), 155 deletions(-) rename themes/matery/{config_matery.js => config.js} (95%) rename themes/medium/{config_medium.js => config.js} (93%) rename themes/next/{config_next.js => config.js} (96%) rename themes/nobelium/{config_nobelium.js => config.js} (82%) rename themes/simple/{config_simple.js => config.js} (90%) diff --git a/themes/landing/components/Newsletter.js b/themes/landing/components/Newsletter.js index 6b3fa0d4..5ddcc02d 100644 --- a/themes/landing/components/Newsletter.js +++ b/themes/landing/components/Newsletter.js @@ -22,7 +22,7 @@ export default function Newsletter() { } form?.addEventListener('submit', handleSubmit) return () => { - form.removeEventListener('submit', handleSubmit) + form?.removeEventListener('submit', handleSubmit) } }, [subscribeToNewsletter]) diff --git a/themes/matery/components/ArticleAdjacent.js b/themes/matery/components/ArticleAdjacent.js index 365f0884..c9991c8c 100644 --- a/themes/matery/components/ArticleAdjacent.js +++ b/themes/matery/components/ArticleAdjacent.js @@ -1,4 +1,4 @@ -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' import BlogPostCard from './BlogPostCard' /** @@ -7,7 +7,7 @@ import BlogPostCard from './BlogPostCard' * @returns */ export default function ArticleAdjacent ({ prev, next, siteInfo }) { - if (!prev || !next || !CONFIG_MATERY.ARTICLE_ADJACENT) { + if (!prev || !next || !CONFIG.ARTICLE_ADJACENT) { return <> } return
diff --git a/themes/matery/components/ArticleCopyright.js b/themes/matery/components/ArticleCopyright.js index 4bd32b7e..d8d9beb9 100644 --- a/themes/matery/components/ArticleCopyright.js +++ b/themes/matery/components/ArticleCopyright.js @@ -3,7 +3,7 @@ import { useGlobal } from '@/lib/global' import Link from 'next/link' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' export default function ArticleCopyright () { const router = useRouter() @@ -14,7 +14,7 @@ export default function ArticleCopyright () { const { locale } = useGlobal() - if (!CONFIG_MATERY.ARTICLE_COPYRIGHT) { + if (!CONFIG.ARTICLE_COPYRIGHT) { return <> } diff --git a/themes/matery/components/ArticleRecommend.js b/themes/matery/components/ArticleRecommend.js index b8e59407..cea75055 100644 --- a/themes/matery/components/ArticleRecommend.js +++ b/themes/matery/components/ArticleRecommend.js @@ -1,5 +1,5 @@ import Link from 'next/link' -import CONFIG_MATERY from '../config_matery' +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_MATERY.ARTICLE_RECOMMEND || + !CONFIG.ARTICLE_RECOMMEND || !recommendPosts || recommendPosts.length === 0 ) { diff --git a/themes/matery/components/BlogPostCard.js b/themes/matery/components/BlogPostCard.js index c8f8476c..f30b5948 100644 --- a/themes/matery/components/BlogPostCard.js +++ b/themes/matery/components/BlogPostCard.js @@ -2,17 +2,17 @@ import BLOG from '@/blog.config' import Link from 'next/link' import React from 'react' import TagItemMini from './TagItemMini' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' import TwikooCommentCount from '@/components/TwikooCommentCount' // import Image from 'next/image' const BlogPostCard = ({ index, post, showSummary, siteInfo }) => { - const showPreview = CONFIG_MATERY.POST_LIST_PREVIEW && post.blockMap + const showPreview = CONFIG.POST_LIST_PREVIEW && post.blockMap // matery 主题默认强制显示图片 if (post && !post.pageCoverThumbnail) { post.pageCoverThumbnail = siteInfo?.pageCover } - const showPageCover = CONFIG_MATERY.POST_LIST_COVER && post?.pageCoverThumbnail + const showPageCover = CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail const delay = (index % 3) * 300 return (
{ +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/matery/components/FloatDarkModeButton.js b/themes/matery/components/FloatDarkModeButton.js index 1b92787e..f912c57b 100644 --- a/themes/matery/components/FloatDarkModeButton.js +++ b/themes/matery/components/FloatDarkModeButton.js @@ -1,11 +1,11 @@ import { useGlobal } from '@/lib/global' import { saveDarkModeToCookies } from '@/themes/theme' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' export default function FloatDarkModeButton() { const { isDarkMode, updateDarkMode } = useGlobal() - if (!CONFIG_MATERY.WIDGET_DARK_MODE) { + if (!CONFIG.WIDGET_DARK_MODE) { return <> } diff --git a/themes/matery/components/Hero.js b/themes/matery/components/Hero.js index c573703d..412f9cf1 100644 --- a/themes/matery/components/Hero.js +++ b/themes/matery/components/Hero.js @@ -1,7 +1,7 @@ // import Image from 'next/image' import { useEffect, useState } from 'react' import Typed from 'typed.js' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' import { useGlobal } from '@/lib/global' import BLOG from '@/blog.config' @@ -65,7 +65,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/matery/components/JumpToCommentButton.js b/themes/matery/components/JumpToCommentButton.js index 0fe9ee98..98abb03f 100644 --- a/themes/matery/components/JumpToCommentButton.js +++ b/themes/matery/components/JumpToCommentButton.js @@ -1,5 +1,5 @@ import React from 'react' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' /** * 跳转到评论区 @@ -7,7 +7,7 @@ import CONFIG_MATERY from '../config_matery' * @constructor */ const JumpToCommentButton = () => { - if (!CONFIG_MATERY.WIDGET_TO_COMMENT) { + if (!CONFIG.WIDGET_TO_COMMENT) { return <> } diff --git a/themes/matery/components/JumpToTopButton.js b/themes/matery/components/JumpToTopButton.js index 2aa762dd..2b1e3018 100644 --- a/themes/matery/components/JumpToTopButton.js +++ b/themes/matery/components/JumpToTopButton.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import React from 'react' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' /** * 跳转到网页顶部 @@ -13,7 +13,7 @@ import CONFIG_MATERY from '../config_matery' const JumpToTopButton = ({ showPercent = true, percent }) => { const { locale } = useGlobal() - if (!CONFIG_MATERY.WIDGET_TO_TOP) { + if (!CONFIG.WIDGET_TO_TOP) { return <> } diff --git a/themes/matery/components/MenuGroupCard.js b/themes/matery/components/MenuGroupCard.js index 9012b936..2c2d2c04 100644 --- a/themes/matery/components/MenuGroupCard.js +++ b/themes/matery/components/MenuGroupCard.js @@ -1,7 +1,7 @@ import React from 'react' import Link from 'next/link' import { useGlobal } from '@/lib/global' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' const MenuGroupCard = (props) => { const { postCount, categories, tags } = props @@ -11,9 +11,9 @@ const MenuGroupCard = (props) => { const tagSlot =
{tags?.length}
const links = [ - { name: locale.COMMON.ARTICLE, to: '/archive', slot: archiveSlot, show: CONFIG_MATERY.MENU_ARCHIVE }, - { name: locale.COMMON.CATEGORY, to: '/category', slot: categorySlot, show: CONFIG_MATERY.MENU_CATEGORY }, - { name: locale.COMMON.TAGS, to: '/tag', slot: tagSlot, show: CONFIG_MATERY.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/matery/components/MenuList.js b/themes/matery/components/MenuList.js index d059498c..6ea230f2 100644 --- a/themes/matery/components/MenuList.js +++ b/themes/matery/components/MenuList.js @@ -2,7 +2,7 @@ import React from 'react' import Link from 'next/link' import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' const MenuList = (props) => { const { postCount, customNav } = props @@ -12,10 +12,10 @@ const MenuList = (props) => { let links = [ { icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true }, - { icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_MATERY.MENU_CATEGORY }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_MATERY.MENU_TAG }, - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_MATERY.MENU_ARCHIVE }, - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_MATERY.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', slot: archiveSlot, show: CONFIG.MENU_ARCHIVE }, + { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH } ] if (customNav) { links = links.concat(customNav) diff --git a/themes/matery/components/MenuListSide.js b/themes/matery/components/MenuListSide.js index eed55d6c..1dc44c93 100644 --- a/themes/matery/components/MenuListSide.js +++ b/themes/matery/components/MenuListSide.js @@ -1,6 +1,6 @@ import React from 'react' import { useGlobal } from '@/lib/global' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' import BLOG from '@/blog.config' import { MenuItemCollapse } from './MenuItemCollapse' @@ -9,10 +9,10 @@ export const MenuListSide = (props) => { const { locale } = useGlobal() let links = [ - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_MATERY.MENU_ARCHIVE }, - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_MATERY.MENU_SEARCH }, - { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_MATERY.MENU_CATEGORY }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_MATERY.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/matery/components/MenuListTop.js b/themes/matery/components/MenuListTop.js index 8094e543..58f06cba 100644 --- a/themes/matery/components/MenuListTop.js +++ b/themes/matery/components/MenuListTop.js @@ -1,6 +1,6 @@ import React from 'react' import { useGlobal } from '@/lib/global' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' import { MenuItemDrop } from './MenuItemDrop' import BLOG from '@/blog.config' @@ -9,10 +9,10 @@ export const MenuListTop = (props) => { const { locale } = useGlobal() let links = [ - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_MATERY.MENU_ARCHIVE }, - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_MATERY.MENU_SEARCH }, - { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_MATERY.MENU_CATEGORY }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_MATERY.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/matery/components/SideRight.js b/themes/matery/components/SideRight.js index 95ccec29..e23a1b1e 100644 --- a/themes/matery/components/SideRight.js +++ b/themes/matery/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_MATERY from '../config_matery' +import CONFIG from '../config' import BLOG from '@/blog.config' import dynamic from 'next/dynamic' @@ -24,7 +24,7 @@ export default function SideRight(props) { return (
- {CONFIG_MATERY.WIDGET_ANALYTICS && } + {CONFIG.WIDGET_ANALYTICS && } {showCategory && ( @@ -42,7 +42,7 @@ export default function SideRight(props) { )} - {CONFIG_MATERY.WIDGET_LATEST_POSTS && latestPosts && latestPosts.length > 0 && + {CONFIG.WIDGET_LATEST_POSTS && latestPosts && latestPosts.length > 0 && } diff --git a/themes/matery/components/TocDrawerButton.js b/themes/matery/components/TocDrawerButton.js index 699bed00..8e5053b6 100644 --- a/themes/matery/components/TocDrawerButton.js +++ b/themes/matery/components/TocDrawerButton.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import React from 'react' -import CONFIG_MATERY from '../config_matery' +import CONFIG from '../config' /** * 点击召唤目录抽屉 @@ -11,7 +11,7 @@ import CONFIG_MATERY from '../config_matery' */ const TocDrawerButton = (props) => { const { locale } = useGlobal() - if (!CONFIG_MATERY.WIDGET_TOC) { + if (!CONFIG.WIDGET_TOC) { return <> } return (
diff --git a/themes/matery/config_matery.js b/themes/matery/config.js similarity index 95% rename from themes/matery/config_matery.js rename to themes/matery/config.js index 6704f642..a772b297 100644 --- a/themes/matery/config_matery.js +++ b/themes/matery/config.js @@ -1,4 +1,4 @@ -const CONFIG_MATERY = { +const CONFIG = { HOME_BANNER_ENABLE: true, // 3.14.1以后的版本中,欢迎语在blog.config.js中配置,用英文逗号','隔开多个。 HOME_BANNER_GREETINGS: ['Hi,我是一个程序员', 'Hi,我是一个打工人', 'Hi,我是一个干饭人', '欢迎来到我的博客🎉'], // 首页大图标语文字 @@ -27,4 +27,4 @@ const CONFIG_MATERY = { WIDGET_DARK_MODE: true, // 夜间模式 WIDGET_TOC: true // 移动端悬浮目录 } -export default CONFIG_MATERY +export default CONFIG diff --git a/themes/matery/index.js b/themes/matery/index.js index cd97c05c..05744dcd 100644 --- a/themes/matery/index.js +++ b/themes/matery/index.js @@ -1,4 +1,4 @@ -import CONFIG_MATERY from './config_matery' +import CONFIG from './config' import CommonHead from '@/components/CommonHead' import TopNav from './components/TopNav' import Live2D from '@/components/Live2D' @@ -70,7 +70,7 @@ const LayoutBase = props => { {headerSlot} -
+
{/* 嵌入区域 */}
{containerSlot} @@ -116,7 +116,7 @@ const LayoutBase = props => { * @returns */ const LayoutIndex = (props) => { - return } headerSlot={CONFIG_MATERY.HOME_BANNER_ENABLE && } /> + return } headerSlot={CONFIG.HOME_BANNER_ENABLE && } /> } /** @@ -365,7 +365,7 @@ const LayoutTagIndex = props => { } export { - CONFIG_MATERY as THEME_CONFIG, + CONFIG as THEME_CONFIG, LayoutIndex, LayoutPostList, LayoutSearch, diff --git a/themes/medium/components/BlogPostCard.js b/themes/medium/components/BlogPostCard.js index 998dd086..2fbbede9 100644 --- a/themes/medium/components/BlogPostCard.js +++ b/themes/medium/components/BlogPostCard.js @@ -3,13 +3,13 @@ import NotionPage from '@/components/NotionPage' import { useGlobal } from '@/lib/global' import Link from 'next/link' import React from 'react' -import CONFIG_MEDIUM from '../config_medium' +import CONFIG from '../config' import CategoryItem from './CategoryItem' import TagItemMini from './TagItemMini' import TwikooCommentCount from '@/components/TwikooCommentCount' const BlogPostCard = ({ post, showSummary }) => { - const showPreview = CONFIG_MEDIUM.POST_LIST_PREVIEW && post.blockMap + const showPreview = CONFIG.POST_LIST_PREVIEW && post.blockMap const { locale } = useGlobal() return (
{ 'cursor-pointer font-bold hover:underline text-3xl leading-tight text-gray-700 dark:text-gray-300 hover:text-green-500 dark:hover:text-green-400' }>
- {CONFIG_MEDIUM.POST_LIST_COVER &&
+ {CONFIG.POST_LIST_COVER &&
{/* eslint-disable-next-line @next/next/no-img-element */}
} @@ -44,8 +44,8 @@ const BlogPostCard = ({ post, showSummary }) => { } >
{post.date?.start_date}
- {CONFIG_MEDIUM.POST_LIST_CATEGORY && } - {CONFIG_MEDIUM.POST_LIST_TAG && post?.tagItems?.map(tag => )} + {CONFIG.POST_LIST_CATEGORY && } + {CONFIG.POST_LIST_TAG && post?.tagItems?.map(tag => )}
diff --git a/themes/medium/components/JumpToTopButton.js b/themes/medium/components/JumpToTopButton.js index 60281369..8b2e1314 100644 --- a/themes/medium/components/JumpToTopButton.js +++ b/themes/medium/components/JumpToTopButton.js @@ -1,4 +1,4 @@ -import CONFIG_MEDIUM from '../config_medium' +import CONFIG from '../config' /** * 跳转到网页顶部 @@ -9,7 +9,7 @@ import CONFIG_MEDIUM from '../config_medium' * @constructor */ const JumpToTopButton = ({ showPercent = false, percent, className }) => { - if (!CONFIG_MEDIUM.WIDGET_TO_TOP) { + if (!CONFIG.WIDGET_TO_TOP) { return <> } return ( diff --git a/themes/medium/components/MenuBarMobile.js b/themes/medium/components/MenuBarMobile.js index 538a9782..d21fbfe5 100644 --- a/themes/medium/components/MenuBarMobile.js +++ b/themes/medium/components/MenuBarMobile.js @@ -1,6 +1,6 @@ import React from 'react' import { useGlobal } from '@/lib/global' -import CONFIG_MEDIUM from '../config_medium' +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_MEDIUM.MENU_CATEGORY }, - { name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_MEDIUM.MENU_TAG }, - { name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_MEDIUM.MENU_ARCHIVE } - // { name: locale.NAV.SEARCH, to: '/search', show: CONFIG_MEDIUM.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/medium/components/TopNavBar.js b/themes/medium/components/TopNavBar.js index b4e01345..67c8a975 100644 --- a/themes/medium/components/TopNavBar.js +++ b/themes/medium/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_MEDIUM from '../config_medium' +import CONFIG from '../config' import BLOG from '@/blog.config' import { MenuItemDrop } from './MenuItemDrop' @@ -20,10 +20,10 @@ export default function TopNavBar(props) { const { locale } = useGlobal() const defaultLinks = [ - { icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_MEDIUM.MENU_CATEGORY }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_MEDIUM.MENU_TAG }, - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_MEDIUM.MENU_ARCHIVE }, - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_MEDIUM.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/medium/config_medium.js b/themes/medium/config.js similarity index 93% rename from themes/medium/config_medium.js rename to themes/medium/config.js index 40f41c97..923863a2 100644 --- a/themes/medium/config_medium.js +++ b/themes/medium/config.js @@ -1,4 +1,4 @@ -const CONFIG_MEDIUM = { +const CONFIG = { // Style RIGHT_PANEL_DARK: process.env.NEXT_PUBLIC_MEDIUM_RIGHT_DARK || false, // 右侧面板深色模式 @@ -21,4 +21,4 @@ const CONFIG_MEDIUM = { WIDGET_REVOLVER_MAPS: process.env.NEXT_PUBLIC_WIDGET_REVOLVER_MAPS || 'false', // 地图插件 WIDGET_TO_TOP: true // 跳回顶部 } -export default CONFIG_MEDIUM +export default CONFIG diff --git a/themes/medium/index.js b/themes/medium/index.js index 9a1496e9..fd102bf1 100644 --- a/themes/medium/index.js +++ b/themes/medium/index.js @@ -1,4 +1,4 @@ -import CONFIG_MEDIUM from './config_medium' +import CONFIG from './config' import CommonHead from '@/components/CommonHead' import { useState, createContext, useContext, useEffect } from 'react' @@ -92,14 +92,14 @@ const LayoutBase = props => {
{/* 桌面端右侧 */} -
+
{slotRight}
{router.pathname !== '/search' && } {showInfoCard && } - {CONFIG_MEDIUM.WIDGET_REVOLVER_MAPS === 'true' && } + {CONFIG.WIDGET_REVOLVER_MAPS === 'true' && }
@@ -168,9 +168,9 @@ const LayoutSlug = props => { {/* 文章分类和标签信息 */}
- {CONFIG_MEDIUM.POST_DETAIL_CATEGORY && post?.category && } + {CONFIG.POST_DETAIL_CATEGORY && post?.category && }
- {CONFIG_MEDIUM.POST_DETAIL_TAG && post?.tagItems?.map(tag => )} + {CONFIG.POST_DETAIL_TAG && post?.tagItems?.map(tag => )}
{/* 上一篇下一篇文章 */} @@ -322,7 +322,7 @@ const LayoutTagIndex = props => { } export { - CONFIG_MEDIUM as THEME_CONFIG, + CONFIG as THEME_CONFIG, LayoutIndex, LayoutPostList, LayoutSearch, diff --git a/themes/next/components/ArticleCopyright.js b/themes/next/components/ArticleCopyright.js index 0e33fd31..143ce4f1 100644 --- a/themes/next/components/ArticleCopyright.js +++ b/themes/next/components/ArticleCopyright.js @@ -1,12 +1,12 @@ import { useGlobal } from '@/lib/global' import Link from 'next/link' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' export default function ArticleCopyright ({ author, url }) { - if (!CONFIG_NEXT.ARTICLE_COPYRIGHT) { + const { locale } = useGlobal() + if (!CONFIG.ARTICLE_COPYRIGHT) { return <> } - const { locale } = useGlobal() return (
    @@ -28,5 +28,5 @@ export default function ArticleCopyright ({ author, url }) {
- ); + ) } diff --git a/themes/next/components/ArticleDetail.js b/themes/next/components/ArticleDetail.js index 2c27d69a..b8fa6c6c 100644 --- a/themes/next/components/ArticleDetail.js +++ b/themes/next/components/ArticleDetail.js @@ -10,7 +10,7 @@ import { useRouter } from 'next/router' import ArticleCopyright from './ArticleCopyright' import WordCount from './WordCount' import NotionPage from '@/components/NotionPage' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' import NotionIcon from '@/components/NotionIcon' /** @@ -22,7 +22,7 @@ export default function ArticleDetail(props) { const { post, recommendPosts, prev, next } = props const url = BLOG.LINK + useRouter().asPath const { locale } = useGlobal() - const showArticleInfo = CONFIG_NEXT.ARTICLE_INFO + const showArticleInfo = CONFIG.ARTICLE_INFO return (
{/* 头图 */} - {CONFIG_NEXT.POST_HEADER_IMAGE_VISIBLE && post?.type && !post?.type !== 'Page' && post?.pageCover && ( + {CONFIG.POST_HEADER_IMAGE_VISIBLE && post?.type && !post?.type !== 'Page' && post?.pageCover && (
{/* eslint-disable-next-line @next/next/no-img-element */} {post.title} diff --git a/themes/next/components/BlogPostCard.js b/themes/next/components/BlogPostCard.js index 7bc2e5d2..4459cff3 100644 --- a/themes/next/components/BlogPostCard.js +++ b/themes/next/components/BlogPostCard.js @@ -5,14 +5,14 @@ import Link from 'next/link' import React from 'react' import Card from './Card' import TagItemMini from './TagItemMini' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' import NotionPage from '@/components/NotionPage' import NotionIcon from '@/components/NotionIcon' import TwikooCommentCount from '@/components/TwikooCommentCount' const BlogPostCard = ({ post, showSummary }) => { const { locale } = useGlobal() - const showPreview = CONFIG_NEXT.POST_LIST_PREVIEW && post.blockMap + const showPreview = CONFIG.POST_LIST_PREVIEW && post.blockMap return (
{
- {CONFIG_NEXT.POST_LIST_COVER && post?.pageCoverThumbnail && ( + {CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail && (
{ +const BlogPostListScroll = ({ posts = [], currentSearch, showSummary = CONFIG.POST_LIST_SUMMARY }) => { const postsPerPage = BLOG.POSTS_PER_PAGE const [page, updatePage] = useState(1) const postsToShow = getPostByPage(page, posts, postsPerPage) diff --git a/themes/next/components/FloatDarkModeButton.js b/themes/next/components/FloatDarkModeButton.js index 58192799..6fef32ff 100644 --- a/themes/next/components/FloatDarkModeButton.js +++ b/themes/next/components/FloatDarkModeButton.js @@ -1,11 +1,11 @@ import { useGlobal } from '@/lib/global' import { saveDarkModeToCookies } from '@/themes/theme' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' export default function FloatDarkModeButton () { const { isDarkMode, updateDarkMode } = useGlobal() - if (!CONFIG_NEXT.WIDGET_DARK_MODE) { + if (!CONFIG.WIDGET_DARK_MODE) { return <> } diff --git a/themes/next/components/Header.js b/themes/next/components/Header.js index 7c828c90..0a5538a9 100644 --- a/themes/next/components/Header.js +++ b/themes/next/components/Header.js @@ -1,7 +1,7 @@ import { useGlobal } from '@/lib/global' import { useEffect, useState } from 'react' import Typed from 'typed.js' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' let wrapperTop = 0 let windowTop = 0 @@ -18,7 +18,7 @@ export default function Header(props) { if (!typed && window && document.getElementById('typed')) { changeType( new Typed('#typed', { - strings: CONFIG_NEXT.HOME_BANNER_Strings, + strings: CONFIG.HOME_BANNER_Strings, typeSpeed: 200, backSpeed: 100, backDelay: 400, diff --git a/themes/next/components/JumpToBottomButton.js b/themes/next/components/JumpToBottomButton.js index c54b7b59..cc624f2b 100644 --- a/themes/next/components/JumpToBottomButton.js +++ b/themes/next/components/JumpToBottomButton.js @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' /** * 跳转到网页顶部 @@ -37,7 +37,7 @@ const JumpToBottomButton = ({ showPercent = false }) => { window.scrollTo({ top: targetRef.clientHeight, behavior: 'smooth' }) } - if (!CONFIG_NEXT.WIDGET_TO_BOTTOM) { + if (!CONFIG.WIDGET_TO_BOTTOM) { return <> } diff --git a/themes/next/components/JumpToTopButton.js b/themes/next/components/JumpToTopButton.js index 9ff51635..9629d65b 100644 --- a/themes/next/components/JumpToTopButton.js +++ b/themes/next/components/JumpToTopButton.js @@ -1,6 +1,6 @@ import { useGlobal } from '@/lib/global' import React from 'react' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' /** * 跳转到网页顶部 @@ -12,7 +12,7 @@ import CONFIG_NEXT from '../config_next' */ const JumpToTopButton = ({ showPercent = true, percent }) => { const { locale } = useGlobal() - if (!CONFIG_NEXT.WIDGET_TO_TOP) { + if (!CONFIG.WIDGET_TO_TOP) { return <> } return (
window.scrollTo({ top: 0, behavior: 'smooth' })} > diff --git a/themes/next/components/MenuList.js b/themes/next/components/MenuList.js index 2953de23..ec03a7bd 100644 --- a/themes/next/components/MenuList.js +++ b/themes/next/components/MenuList.js @@ -1,6 +1,6 @@ import React from 'react' import { useGlobal } from '@/lib/global' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' import BLOG from '@/blog.config' import { MenuItemDrop } from './MenuItemDrop' import { MenuItemCollapse } from './MenuItemCollapse' @@ -12,9 +12,9 @@ export const MenuList = (props) => { const defaultLinks = [ { id: 1, icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true }, - { id: 2, icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_NEXT.MENU_CATEGORY }, - { id: 3, icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_NEXT.MENU_TAG }, - { id: 4, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_NEXT.MENU_ARCHIVE } + { id: 2, icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY }, + { id: 3, icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG }, + { id: 4, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG.MENU_ARCHIVE } ] let links = [].concat(defaultLinks) diff --git a/themes/next/components/RecommendPosts.js b/themes/next/components/RecommendPosts.js index 26d9010d..1626f664 100644 --- a/themes/next/components/RecommendPosts.js +++ b/themes/next/components/RecommendPosts.js @@ -1,13 +1,13 @@ import React from 'react' import Link from 'next/link' import { useGlobal } from '@/lib/global' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' /** * 展示文章推荐 */ const RecommendPosts = ({ recommendPosts }) => { - if (!CONFIG_NEXT.ARTICLE_RELATE_POSTS || !recommendPosts || recommendPosts.length < 1) { + if (!CONFIG.ARTICLE_RELATE_POSTS || !recommendPosts || recommendPosts.length < 1) { return <> } const { locale } = useGlobal() diff --git a/themes/next/components/SideAreaLeft.js b/themes/next/components/SideAreaLeft.js index 7ff48ada..0fb39643 100644 --- a/themes/next/components/SideAreaLeft.js +++ b/themes/next/components/SideAreaLeft.js @@ -7,7 +7,7 @@ import React from 'react' import Tabs from '@/components/Tabs' import Logo from './Logo' import Card from './Card' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' import BLOG from '@/blog.config' import Live2D from '@/components/Live2D' @@ -34,7 +34,7 @@ const SideAreaLeft = props => {
- {CONFIG_NEXT.MENU_SEARCH &&
+ {CONFIG.MENU_SEARCH &&
} diff --git a/themes/next/components/SideAreaRight.js b/themes/next/components/SideAreaRight.js index 01c36b49..e23759c4 100644 --- a/themes/next/components/SideAreaRight.js +++ b/themes/next/components/SideAreaRight.js @@ -4,7 +4,7 @@ import React from 'react' import Card from './Card' import CategoryGroup from './CategoryGroup' import TagGroups from './TagGroups' -import CONFIG_NEXT from '../config_next' +import CONFIG from '../config' import { useRouter } from 'next/router' import BLOG from '@/blog.config' import dynamic from 'next/dynamic' @@ -30,7 +30,7 @@ const SideAreaRight = (props) => { return (
{/* 右下角悬浮 */} @@ -130,7 +130,7 @@ const LayoutBase = (props) => { * @returns */ const LayoutIndex = (props) => { - return } {...props} /> + return } {...props} /> } /** @@ -328,7 +328,7 @@ const LayoutTagIndex = (props) => { } export { - CONFIG_NEXT as THEME_CONFIG, + CONFIG as THEME_CONFIG, LayoutIndex, LayoutSearch, LayoutArchive, diff --git a/themes/nobelium/components/Nav.js b/themes/nobelium/components/Nav.js index 010d0f86..e3d73a8a 100644 --- a/themes/nobelium/components/Nav.js +++ b/themes/nobelium/components/Nav.js @@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react' import Link from 'next/link' import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' -import CONFIG_NOBELIUM from '../config_nobelium' +import CONFIG from '../config' import { SvgIcon } from './SvgIcon' import { MenuItemDrop } from './MenuItemDrop' import Collapse from '@/components/Collapse' @@ -46,7 +46,7 @@ const Nav = props => {
{/* */} - {CONFIG_NOBELIUM.NAV_NOTION_ICON + {CONFIG.NAV_NOTION_ICON /* eslint-disable-next-line @next/next/no-img-element */ ? {BLOG.AUTHOR} : } @@ -82,11 +82,11 @@ const NavBar = props => { const { locale } = useGlobal() let links = [ - { id: 2, name: locale.NAV.RSS, to: '/feed', show: BLOG.ENABLE_RSS && CONFIG_NOBELIUM.MENU_RSS, target: '_blank' }, - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_NOBELIUM.MENU_SEARCH }, - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_NOBELIUM.MENU_ARCHIVE }, - { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_NOBELIUM.MENU_CATEGORY }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_NOBELIUM.MENU_TAG } + { id: 2, name: locale.NAV.RSS, to: '/feed', show: BLOG.ENABLE_RSS && CONFIG.MENU_RSS, target: '_blank' }, + { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH }, + { 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) { links = links.concat(customNav) diff --git a/themes/nobelium/config_nobelium.js b/themes/nobelium/config.js similarity index 82% rename from themes/nobelium/config_nobelium.js rename to themes/nobelium/config.js index 0385e9d7..75f2e597 100644 --- a/themes/nobelium/config_nobelium.js +++ b/themes/nobelium/config.js @@ -1,4 +1,4 @@ -const CONFIG_NOBELIUM = { +const CONFIG = { // 菜单配置 MENU_CATEGORY: false, // 显示分类 @@ -10,4 +10,4 @@ const CONFIG_NOBELIUM = { NAV_NOTION_ICON: true // 是否读取Notion图标作为站点头像 } -export default CONFIG_NOBELIUM +export default CONFIG diff --git a/themes/nobelium/index.js b/themes/nobelium/index.js index ab8789dc..f0412b92 100644 --- a/themes/nobelium/index.js +++ b/themes/nobelium/index.js @@ -1,4 +1,4 @@ -import CONFIG_NOBELIUM from './config_nobelium' +import CONFIG from './config' import CommonHead from '@/components/CommonHead' import React, { useEffect, useState } from 'react' import Nav from './components/Nav' @@ -264,7 +264,7 @@ const LayoutTagIndex = (props) => { } export { - CONFIG_NOBELIUM as THEME_CONFIG, + CONFIG as THEME_CONFIG, LayoutIndex, LayoutSearch, LayoutArchive, diff --git a/themes/simple/components/ArticleInfo.js b/themes/simple/components/ArticleInfo.js index 614d457a..93921c7c 100644 --- a/themes/simple/components/ArticleInfo.js +++ b/themes/simple/components/ArticleInfo.js @@ -1,6 +1,6 @@ import Link from 'next/link' import { useGlobal } from '@/lib/global' -import CONFIG_SIMPLE from '../config_simple' +import CONFIG from '../config' import BLOG from '@/blog.config' export const ArticleInfo = (props) => { @@ -18,7 +18,7 @@ export const ArticleInfo = (props) => { {post?.type !== 'Page' && (<>
- {BLOG.AUTHOR} + {BLOG.AUTHOR} - {post?.publishTime} {post?.category && - {post?.category}} {post?.tags && post.tags?.length > 0 && post?.tags.map(t => / {t})} diff --git a/themes/simple/components/BlogItem.js b/themes/simple/components/BlogItem.js index c0bd9ecf..8a5561c7 100644 --- a/themes/simple/components/BlogItem.js +++ b/themes/simple/components/BlogItem.js @@ -1,6 +1,6 @@ import BLOG from '@/blog.config' import Link from 'next/link' -import CONFIG_SIMPLE from '../config_simple' +import CONFIG from '../config' import TwikooCommentCount from '@/components/TwikooCommentCount' export const BlogItem = props => { @@ -21,7 +21,7 @@ export const BlogItem = props => {
- {BLOG.AUTHOR} + {BLOG.AUTHOR} {post.date?.start_date || post.createdTime} diff --git a/themes/simple/components/Header.js b/themes/simple/components/Header.js index fe66ee7d..36ff3b44 100644 --- a/themes/simple/components/Header.js +++ b/themes/simple/components/Header.js @@ -1,8 +1,8 @@ import BLOG from '@/blog.config' import Link from 'next/link' -import CONFIG_SIMPLE from '../config_simple' +import CONFIG from '../config' import SocialButton from './SocialButton' -// import CONFIG_SIMPLE from '../config_simple' +// import CONFIG from '../config_simple' /** * 网站顶部 @@ -18,7 +18,7 @@ export const Header = (props) => { {/* 可使用一张单图作为logo */} {/* eslint-disable-next-line @next/next/no-img-element */} - {/* */} + {/* */}
{/* eslint-disable-next-line @next/next/no-img-element */} @@ -27,7 +27,7 @@ export const Header = (props) => {
{BLOG.AUTHOR}
-
+
diff --git a/themes/simple/components/MenuList.js b/themes/simple/components/MenuList.js index 6622d209..ba15befa 100644 --- a/themes/simple/components/MenuList.js +++ b/themes/simple/components/MenuList.js @@ -3,7 +3,7 @@ import Collapse from '@/components/Collapse' import { useGlobal } from '@/lib/global' import { useRouter } from 'next/router' import { useEffect, useRef, useState } from 'react' -import CONFIG_SIMPLE from '../config_simple' +import CONFIG from '../config' import { MenuItemCollapse } from './MenuItemCollapse' import { MenuItemDrop } from './MenuItemDrop' @@ -29,10 +29,10 @@ export const MenuList = ({ customNav, customMenu }) => { }) let links = [ - { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_SIMPLE.MENU_SEARCH }, - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_SIMPLE.MENU_ARCHIVE }, - { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_SIMPLE.MENU_CATEGORY }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_SIMPLE.MENU_TAG } + { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH }, + { 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/simple/components/TopBar.js b/themes/simple/components/TopBar.js index ef18fd75..eca11258 100644 --- a/themes/simple/components/TopBar.js +++ b/themes/simple/components/TopBar.js @@ -1,14 +1,14 @@ -import CONFIG_SIMPLE from '../config_simple' +import CONFIG from '../config' /** * 网站顶部 提示栏 * @returns */ export const TopBar = (props) => { - if (CONFIG_SIMPLE.TOP_BAR_CONTENT) { + if (CONFIG.TOP_BAR_CONTENT) { return
-
+
} diff --git a/themes/simple/config_simple.js b/themes/simple/config.js similarity index 90% rename from themes/simple/config_simple.js rename to themes/simple/config.js index 068daf36..4e4804bd 100644 --- a/themes/simple/config_simple.js +++ b/themes/simple/config.js @@ -1,4 +1,4 @@ -const CONFIG_SIMPLE = { +const CONFIG = { LOGO_IMG: '/Logo.webp', TOP_BAR: true, // 显示顶栏 @@ -13,4 +13,4 @@ const CONFIG_SIMPLE = { MENU_ARCHIVE: true, // 显示归档 MENU_SEARCH: true // 显示搜索 } -export default CONFIG_SIMPLE +export default CONFIG diff --git a/themes/simple/index.js b/themes/simple/index.js index f37fab66..059fb0b1 100644 --- a/themes/simple/index.js +++ b/themes/simple/index.js @@ -1,4 +1,4 @@ -import CONFIG_SIMPLE from './config_simple' +import CONFIG from './config' import { BlogListPage } from './components/BlogListPage' import { BlogListScroll } from './components/BlogListScroll' import { useRouter } from 'next/router' @@ -43,7 +43,7 @@ const LayoutBase = props => {
- {CONFIG_SIMPLE.TOP_BAR && } + {CONFIG.TOP_BAR && } {/* 顶部LOGO */}
@@ -262,7 +262,7 @@ const LayoutTagIndex = (props) => { } export { - CONFIG_SIMPLE as THEME_CONFIG, + CONFIG as THEME_CONFIG, LayoutIndex, LayoutSearch, LayoutArchive,