From 525867e62b6f3bfe6f24fb9223d65991846af138 Mon Sep 17 00:00:00 2001 From: cxf <839989072@qq.com> Date: Thu, 29 May 2025 10:02:57 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B5=8B=E8=AF=95git2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 测试提交2.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 测试提交2.txt diff --git a/测试提交2.txt b/测试提交2.txt new file mode 100644 index 0000000..e69de29 From f08d6b840a77a5f8bcaf8f0a5382acfef33a535d Mon Sep 17 00:00:00 2001 From: icybox Date: Thu, 29 May 2025 10:03:20 +0800 Subject: [PATCH 2/4] =?UTF-8?q?Delete=20=E6=B5=8B=E8=AF=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 测试提交.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 测试提交.txt diff --git a/测试提交.txt b/测试提交.txt deleted file mode 100644 index e69de29..0000000 From 028334b1f477ad99b1748db0f3e06ec4957dc126 Mon Sep 17 00:00:00 2001 From: icybox Date: Thu, 29 May 2025 10:03:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?Delete=20=E6=B5=8B=E8=AF=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A42.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 测试提交2.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 测试提交2.txt diff --git a/测试提交2.txt b/测试提交2.txt deleted file mode 100644 index e69de29..0000000 From bc6caccaddeb63325c47dfe0282c87a9d9b48d8d Mon Sep 17 00:00:00 2001 From: cxf <839989072@qq.com> Date: Thu, 29 May 2025 10:28:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=A0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=8E=BB=E5=88=B0=E5=BA=95=E9=83=A8=EF=BC=8C=E6=96=B9?= =?UTF-8?q?=E4=BE=BF=E7=94=A8=E6=88=B7=E8=83=BD=E5=A4=9F=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=AE=8C=E9=95=BF=E9=A1=B5=E9=9D=A2QAQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docusaurus.config.js | 4 +++ src/components/BackToBottomNavbarItem.js | 39 ++++++++++++++++++++++++ src/theme/NavbarItem/ComponentTypes.js | 2 ++ src/theme/NavbarItem/index.js | 4 +++ 测试提交.txt | 0 测试提交2.txt | 0 6 files changed, 49 insertions(+) create mode 100644 src/components/BackToBottomNavbarItem.js delete mode 100644 测试提交.txt delete mode 100644 测试提交2.txt diff --git a/docusaurus.config.js b/docusaurus.config.js index 9f11fb0..5a1a81f 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -97,6 +97,10 @@ module.exports = { type: 'custom-back-to-top', position: 'right' }, + { + type: 'custom-back-to-bottom', + position: 'right' + }, { type: 'custom-qa-button', position: 'right' diff --git a/src/components/BackToBottomNavbarItem.js b/src/components/BackToBottomNavbarItem.js new file mode 100644 index 0000000..75d6769 --- /dev/null +++ b/src/components/BackToBottomNavbarItem.js @@ -0,0 +1,39 @@ +import React from 'react'; +import BrowserOnly from '@docusaurus/BrowserOnly'; + +function BackToBottomButton() { + const handleBackToBottom = () => { + window.scrollTo({ + top: document.documentElement.scrollHeight, + behavior: 'smooth' + }); + }; + + return ( + + ); +} + +export default function BackToBottomNavbarItem() { + return ( + {() => } + ); +} \ No newline at end of file diff --git a/src/theme/NavbarItem/ComponentTypes.js b/src/theme/NavbarItem/ComponentTypes.js index 48d9ebe..2f87a74 100644 --- a/src/theme/NavbarItem/ComponentTypes.js +++ b/src/theme/NavbarItem/ComponentTypes.js @@ -9,6 +9,7 @@ import SearchNavbarItem from '@theme/NavbarItem/SearchNavbarItem'; import PdfExportNavbarItem from '../../components/PdfExportNavbarItem'; import PdfBackToTopNavbarItem from '../../components/PdfBackToTopNavbarItem'; +import BackToBottomNavbarItem from '../../components/BackToBottomNavbarItem'; import QAButtonNavbarItem from '../../components/QAButtonNavbarItem'; import TableOfContentsNavbarItem from '../../components/TableOfContentsNavbarItem'; @@ -23,6 +24,7 @@ const ComponentTypes = { docSidebar: DocSidebarNavbarItem, 'custom-pdf-export': PdfExportNavbarItem, 'custom-back-to-top': PdfBackToTopNavbarItem, + 'custom-back-to-bottom': BackToBottomNavbarItem, 'custom-qa-button': QAButtonNavbarItem, 'custom-table-of-contents': TableOfContentsNavbarItem, }; diff --git a/src/theme/NavbarItem/index.js b/src/theme/NavbarItem/index.js index 5684553..be35479 100644 --- a/src/theme/NavbarItem/index.js +++ b/src/theme/NavbarItem/index.js @@ -2,6 +2,7 @@ import React from 'react'; import NavbarItem from '@theme-original/NavbarItem'; import PdfExportNavbarItem from '../../components/PdfExportNavbarItem'; import PdfBackToTopNavbarItem from '../../components/PdfBackToTopNavbarItem'; +import BackToBottomNavbarItem from '../../components/BackToBottomNavbarItem'; import QAButtonNavbarItem from '../../components/QAButtonNavbarItem'; export default function NavbarItemWrapper(props) { @@ -11,6 +12,9 @@ export default function NavbarItemWrapper(props) { if (props.type === 'custom-back-to-top') { return ; } + if (props.type === 'custom-back-to-bottom') { + return ; + } if (props.type === 'custom-qa-button') { return ; } diff --git a/测试提交.txt b/测试提交.txt deleted file mode 100644 index e69de29..0000000 diff --git a/测试提交2.txt b/测试提交2.txt deleted file mode 100644 index e69de29..0000000