From 72736d68089b696628f9c04c01fb3f841504a251 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Tue, 24 Sep 2024 14:51:30 +0800 Subject: [PATCH] =?UTF-8?q?gitbook=E4=B8=BB=E9=A2=98=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + lib/config.js | 2 +- themes/gitbook/components/ArticleInfo.js | 13 +++- themes/gitbook/components/BottomMenuBar.js | 2 +- themes/gitbook/components/Catalog.js | 5 +- themes/gitbook/components/Footer.js | 23 +++--- themes/gitbook/components/Header.js | 4 +- themes/gitbook/components/JumpToTopButton.js | 2 +- themes/gitbook/components/LogoBar.js | 6 +- themes/gitbook/components/NavPostItem.js | 6 +- themes/gitbook/components/NavPostList.js | 2 +- themes/gitbook/components/SearchInput.js | 2 +- themes/gitbook/components/SocialButton.js | 1 + themes/gitbook/index.js | 74 ++++++++++---------- tsconfig.json | 26 +++---- 15 files changed, 82 insertions(+), 87 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a40450ac..e2a5efe4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,6 +5,7 @@ module.exports = { node: true }, extends: [ + 'plugin:react/jsx-runtime', 'plugin:react/recommended', 'plugin:@next/next/recommended', 'standard', diff --git a/lib/config.js b/lib/config.js index 13d805ba..63781524 100644 --- a/lib/config.js +++ b/lib/config.js @@ -50,7 +50,7 @@ export const siteConfig = (key, defaultVal = null, extendConfig = {}) => { // console.warn('SiteConfig警告', key, error) } - // 首先 配置最优先读取NOTION中的表格配置 + // 配置最优先读取NOTION中的表格配置 let val = null let siteInfo = null diff --git a/themes/gitbook/components/ArticleInfo.js b/themes/gitbook/components/ArticleInfo.js index b2d58efe..d559a90d 100644 --- a/themes/gitbook/components/ArticleInfo.js +++ b/themes/gitbook/components/ArticleInfo.js @@ -1,9 +1,16 @@ +/** + * 文章补充咨询 + * @param {*} param0 + * @returns + */ export default function ArticleInfo({ post }) { if (!post) { return null } - return
- - Last update: { post.date?.start_date} + return ( +
+ + Last update: {post.date?.start_date}
+ ) } diff --git a/themes/gitbook/components/BottomMenuBar.js b/themes/gitbook/components/BottomMenuBar.js index 79b498ea..478a52eb 100644 --- a/themes/gitbook/components/BottomMenuBar.js +++ b/themes/gitbook/components/BottomMenuBar.js @@ -12,7 +12,7 @@ export default function BottomMenuBar({ post, className }) { return ( <> {/* 移动端底部导航按钮 */} -
+
diff --git a/themes/gitbook/components/Catalog.js b/themes/gitbook/components/Catalog.js index 9173fa7d..0aa0d337 100644 --- a/themes/gitbook/components/Catalog.js +++ b/themes/gitbook/components/Catalog.js @@ -81,14 +81,15 @@ const Catalog = ({ post }) => { + className={`truncate`}> {tocItem.text} diff --git a/themes/gitbook/components/Footer.js b/themes/gitbook/components/Footer.js index 60dc84b3..3a50e907 100644 --- a/themes/gitbook/components/Footer.js +++ b/themes/gitbook/components/Footer.js @@ -13,12 +13,10 @@ const Footer = ({ siteInfo }) => { parseInt(since) < currentYear ? since + '-' + currentYear : currentYear return ( -