From 6b7e35da8f3468d4c4601144ce737135822987ea Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 8 Dec 2022 16:32:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AFpdf=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- styles/notion.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/styles/notion.css b/styles/notion.css index adf92a8c..0f313528 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -1978,4 +1978,10 @@ pre[class*='language-'] { .notion-asset-wrapper-pdf>div{ width:unset!important +} + +/* pdf预览适配页面 */ +.react-pdf__Page__canvas,.react-pdf__Page__textContent{ + width: 100% !important; + height: auto !important; } \ No newline at end of file From 1054503b1131fcdf47745ea8a23410af28b8f78a Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 8 Dec 2022 16:33:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E5=A4=8D=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/WalineComponent.js | 6 ++++-- themes/next/LayoutBase.js | 1 + themes/next/components/MenuButtonGroup.js | 9 +++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/components/WalineComponent.js b/components/WalineComponent.js index 09983f23..c3da56ab 100644 --- a/components/WalineComponent.js +++ b/components/WalineComponent.js @@ -62,8 +62,10 @@ const WalineComponent = (props) => { } return () => { - waline.destroy() - waline = null + if (waline) { + waline.destroy() + waline = null + } router.events.off('routeChangeComplete', updateWaline) } }, []) diff --git a/themes/next/LayoutBase.js b/themes/next/LayoutBase.js index 3f0043a2..e178da0f 100644 --- a/themes/next/LayoutBase.js +++ b/themes/next/LayoutBase.js @@ -69,6 +69,7 @@ const LayoutBase = (props) => {
+ {/* 左侧栏样式 */}
{onLoading ? : <> {children} } diff --git a/themes/next/components/MenuButtonGroup.js b/themes/next/components/MenuButtonGroup.js index 07cb95fc..b6930e5f 100644 --- a/themes/next/components/MenuButtonGroup.js +++ b/themes/next/components/MenuButtonGroup.js @@ -10,22 +10,23 @@ const MenuButtonGroup = (props) => { const router = useRouter() const archiveSlot =
{postCount}
- let links = [ + const defaultLinks = [ { icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true }, { icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_NEXT.MENU_CATEGORY }, { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_NEXT.MENU_TAG }, { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_NEXT.MENU_ARCHIVE }, { icon: 'fas fa-user', name: locale.NAV.ABOUT, to: '/about', show: CONFIG_NEXT.MENU_ABOUT } ] + let links = [].concat(defaultLinks) if (customNav) { - links = links.concat(customNav) + links = defaultLinks.concat(customNav) } return From 65eee88b971f4e02ec0cf7263e9382e9b5fee922 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 8 Dec 2022 16:34:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8A=98=E5=8F=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/PrismMac.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/PrismMac.js b/components/PrismMac.js index 687bf666..22fc3709 100644 --- a/components/PrismMac.js +++ b/components/PrismMac.js @@ -23,8 +23,8 @@ const PrismMac = () => { const observer = new MutationObserver(mutationsList => { for (const m of mutationsList) { if (m.target.nodeName === 'DETAILS') { - const preCode = m.target.querySelector('pre.notion-code') - if (preCode) { + const preCodes = m.target.querySelectorAll('pre.notion-code') + for (const preCode of preCodes) { Prism.plugins.lineNumbers.resize(preCode) } }