From 09f4e091a7dde4dc5c02ab60399010968cdd2d10 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 13 Sep 2024 21:09:57 +0800 Subject: [PATCH] =?UTF-8?q?magzine=20=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.js | 3 ++- themes/magzine/components/Header.js | 6 +++--- themes/magzine/components/PostGroupArchive.js | 4 ++-- themes/magzine/components/PostListPage.js | 2 +- themes/magzine/index.js | 17 ++++++++++------- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/next.config.js b/next.config.js index 2f306b11..4fd41a58 100644 --- a/next.config.js +++ b/next.config.js @@ -15,7 +15,7 @@ const themes = scanSubdirectories(path.resolve(__dirname, 'themes')) const locales = (function () { // 根据BLOG_NOTION_PAGE_ID 检查支持多少种语言数据. // 支持如下格式配置多个语言的页面id xxx,zh:xxx,en:xxx - let langs = [BLOG.LANG.slice(0, 2)] + const langs = [BLOG.LANG.slice(0, 2)] if (BLOG.NOTION_PAGE_ID.indexOf(',') > 0) { const siteIds = BLOG.NOTION_PAGE_ID.split(',') for (let index = 0; index < siteIds.length; index++) { @@ -33,6 +33,7 @@ const locales = (function () { })() // 编译前执行 +// eslint-disable-next-line no-unused-vars const preBuild = (function () { if ( !process.env.npm_lifecycle_event === 'export' && diff --git a/themes/magzine/components/Header.js b/themes/magzine/components/Header.js index d93317d1..d568fd97 100644 --- a/themes/magzine/components/Header.js +++ b/themes/magzine/components/Header.js @@ -4,11 +4,11 @@ import { useGlobal } from '@/lib/global' import throttle from 'lodash.throttle' import { useRouter } from 'next/router' import { useEffect, useRef, useState } from 'react' +import { useMagzineGlobal } from '..' import CONFIG from '../config' import LogoBar from './LogoBar' import { MenuBarMobile } from './MenuBarMobile' import { MenuItemDrop } from './MenuItemDrop' -import { useMagzineGlobal } from '..' /** * 顶部导航栏 + 菜单 @@ -22,7 +22,7 @@ export default function Header(props) { const lastScrollY = useRef(0) // 用于存储上一次的滚动位置 const { locale } = useGlobal() const router = useRouter() - const {searchModal} = useMagzineGlobal() + const { searchModal } = useMagzineGlobal() const defaultLinks = [ { @@ -155,7 +155,7 @@ export default function Header(props) { )} {/* 右侧移动端折叠按钮 */} -
+
{/* 搜索按钮 */}
{ } return ( -
+
{/* 分组标题 */}
{
{/* 列表 */} -
    +
      {posts?.map((p, index) => { return })} diff --git a/themes/magzine/components/PostListPage.js b/themes/magzine/components/PostListPage.js index ba35d0d5..79e58b9f 100644 --- a/themes/magzine/components/PostListPage.js +++ b/themes/magzine/components/PostListPage.js @@ -25,7 +25,7 @@ const PostListPage = ({ page = 1, posts = [], postCount }) => {
      {/* 列表 */} -
        +
          {posts?.map((p, index) => { return })} diff --git a/themes/magzine/index.js b/themes/magzine/index.js index 139617c9..387ef437 100644 --- a/themes/magzine/index.js +++ b/themes/magzine/index.js @@ -49,7 +49,8 @@ const LayoutBase = props => { const searchModal = useRef(null) return ( - + {/* CSS样式 */}