diff --git a/.env.local b/.env.local index 61bd04c0..ce96b790 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,2 @@ # 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=3.6.3 \ No newline at end of file +NEXT_PUBLIC_VERSION=3.6.4 \ No newline at end of file diff --git a/README.md b/README.md index df20f48e..24b65760 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,8 @@ yarn run start # 本地启动NextJS服务 SwwweetOrange
SwwweetOrange

🔧 🐛 + Ylarod
Ylarod

🔧 🐛 +v 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) } } 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/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index d76499b8..50c84696 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -223,7 +223,8 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { return post && post.type && (post.type === 'Post' || post.type === 'Page') && - (post.status === 'Published' || post.status === 'Invisible') + (post.status === 'Published' || post.status === 'Invisible') && + (!post.slug.startsWith('http')) }) // Sort by date diff --git a/package.json b/package.json index a09fc887..6eb4edad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notion-next", - "version": "3.6.3", + "version": "3.6.4", "homepage": "https://github.com/tangly1024/NotionNext.git", "license": "MIT", "repository": { diff --git a/styles/notion.css b/styles/notion.css index adf92a8c..c85608a9 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -1910,10 +1910,6 @@ pre[class*='language-'] { width: 100% !important; } -.notion-simple-table td { - white-space: nowrap; -} - .pre-mac { position: relative; margin-top: -7px; @@ -1978,4 +1974,22 @@ pre[class*='language-'] { .notion-asset-wrapper-pdf>div{ width:unset!important -} \ No newline at end of file +} + +/* pdf预览适配页面 */ +.react-pdf__Page__canvas,.react-pdf__Page__textContent{ + width: 100% !important; + height: auto !important; +} + + +/* simple table设置 */ +table,thead,tbody{ + display:block +} + +thead, tbody tr { + display:table; + width:100%; + table-layout:fixed; +} diff --git a/themes/medium/LayoutSearch.js b/themes/medium/LayoutSearch.js index 76a9ddae..0ff29b6d 100644 --- a/themes/medium/LayoutSearch.js +++ b/themes/medium/LayoutSearch.js @@ -9,15 +9,19 @@ import BLOG from '@/blog.config' import Mark from 'mark.js' import BlogPostListScroll from './components/BlogPostListScroll' import BlogPostListPage from './components/BlogPostListPage' +import { useRouter } from 'next/router' export const LayoutSearch = (props) => { const { locale } = useGlobal() const { keyword } = props + const router = useRouter() + const currentSearch = keyword || router?.query?.s + useEffect(() => { setTimeout(() => { const container = isBrowser() && document.getElementById('container') if (container && container.innerHTML) { - const re = new RegExp(keyword, 'gim') + const re = new RegExp(currentSearch, 'gim') const instance = new Mark(container) instance.markRegExp(re, { element: 'span', @@ -28,14 +32,20 @@ export const LayoutSearch = (props) => { 100) }) return +
{locale.NAV.SEARCH}
- - + + + {!currentSearch && <> + + } +
-
+ + {currentSearch &&
{BLOG.POST_LIST_STYLE === 'page' ? : } -
+
}
} diff --git a/themes/medium/LayoutSlug.js b/themes/medium/LayoutSlug.js index e0c52b84..f7fdc4d0 100644 --- a/themes/medium/LayoutSlug.js +++ b/themes/medium/LayoutSlug.js @@ -12,9 +12,7 @@ export const LayoutSlug = props => { const { locale } = useGlobal() if (!post) { - return } @@ -30,15 +28,8 @@ export const LayoutSlug = props => { ) return ( - - - {!lock && } - - {lock && } + + {!lock ? : } ) } diff --git a/themes/medium/components/ArticleDetail.js b/themes/medium/components/ArticleDetail.js index 5e6c4da5..ea129207 100644 --- a/themes/medium/components/ArticleDetail.js +++ b/themes/medium/components/ArticleDetail.js @@ -21,25 +21,24 @@ export const ArticleDetail = props => { return
{/* title */} -

{post?.title}

+

{post?.title}

{/* meta */} -
-
- {date} - | - {post.lastEditedTime} -
- - +
+
+ {date} + | + {post.lastEditedTime} +
+
{/* eslint-disable-next-line @next/next/no-img-element */} - + -
+
{BLOG.AUTHOR}
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