diff --git a/components/NotionPage.js b/components/NotionPage.js index 5b9080f1..e195e24d 100644 --- a/components/NotionPage.js +++ b/components/NotionPage.js @@ -7,8 +7,8 @@ import { isBrowser } from '@/lib/utils' import Image from 'next/image' import Link from 'next/link' import { Code } from 'react-notion-x/build/third-party/code' -import { Pdf } from 'react-notion-x/build/third-party/pdf' -import { Equation } from 'react-notion-x/build/third-party/equation' +// import { Pdf } from 'react-notion-x/build/third-party/pdf' +// import { Equation } from 'react-notion-x/build/third-party/equation' import 'prismjs/components/prism-bash.js' import 'prismjs/components/prism-markup-templating.js' @@ -43,8 +43,19 @@ import 'prismjs/components/prism-wasm.js' import 'prismjs/components/prism-yaml.js' import 'prismjs/components/prism-r.js' -// 化学方程式 -import '@/lib/mhchem' +const Equation = dynamic(() => + import('react-notion-x/build/third-party/equation').then(async (m) => { + // 化学方程式 + await import('@/lib/mhchem') + return m.Equation + }) +) +const Pdf = dynamic( + () => import('react-notion-x/build/third-party/pdf').then((m) => m.Pdf), + { + ssr: false + } +) // https://github.com/txs // import PrismMac from '@/components/PrismMac' diff --git a/pages/search/[keyword]/index.js b/pages/search/[keyword]/index.js index 91b55de6..f26b77ea 100644 --- a/pages/search/[keyword]/index.js +++ b/pages/search/[keyword]/index.js @@ -120,7 +120,7 @@ async function filterByMemCache(allPosts, keyword) { const tagContent = post.tags && Array.isArray(post.tags) ? post.tags.join(' ') : '' const categoryContent = post.category && Array.isArray(post.category) ? post.category.join(' ') : '' const articleInfo = post.title + post.summary + tagContent + categoryContent - let hit = articleInfo.indexOf(keyword) > -1 + let hit = articleInfo.toLowerCase().indexOf(keyword) > -1 let indexContent = [post.summary] if (page && page.block) { const contentIds = Object.keys(page.block) diff --git a/styles/notion.css b/styles/notion.css index b717e39a..1e64a28d 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -1941,4 +1941,8 @@ pre[class*='language-'] { .pre-mac > span:nth-child(3) { background: limegreen; +} + +.notion-asset-wrapper-pdf > div { + display: block !important; } \ No newline at end of file diff --git a/styles/prism-mac-style.css b/styles/prism-mac-style.css index 9f2c5098..da5d7fdf 100644 --- a/styles/prism-mac-style.css +++ b/styles/prism-mac-style.css @@ -72,4 +72,8 @@ pre[class*='language-'] { pre[class*="language-mermaid"] { background: transparent !important; @apply dark:bg-gray-200 !important; +} + +.line-numbers-rows > span { + height:auto !important; } \ No newline at end of file