mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 07:26:46 +00:00
@@ -1,2 +1,2 @@
|
|||||||
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
|
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
|
||||||
NEXT_PUBLIC_VERSION=3.6.0
|
NEXT_PUBLIC_VERSION=3.6.1
|
||||||
@@ -55,33 +55,18 @@ function renderPrismMac() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
// Add pre-mac element for Mac Style UI
|
|
||||||
if (codeToolBars) {
|
|
||||||
Array.from(codeToolBars).forEach(item => {
|
|
||||||
const existPreMac = item.getElementsByClassName('pre-mac')
|
|
||||||
if (existPreMac.length < codeToolBars.length) {
|
|
||||||
const preMac = document.createElement('div')
|
|
||||||
preMac.classList.add('pre-mac')
|
|
||||||
preMac.innerHTML = '<span></span><span></span><span></span>'
|
|
||||||
item?.appendChild(preMac, item)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, 10)
|
|
||||||
|
|
||||||
// 支持 Mermaid
|
// 支持 Mermaid
|
||||||
const mermaids = document.querySelectorAll('.notion-code .language-mermaid')
|
const mermaids = document.querySelectorAll('.notion-code .language-mermaid')
|
||||||
if (mermaids) {
|
if (mermaids) {
|
||||||
for (const e of mermaids) {
|
for (const e of mermaids) {
|
||||||
e.parentElement.parentElement.classList.remove('code-toolbar')
|
e.parentElement.classList.remove('code-toolbar')
|
||||||
const chart = e.firstChild.textContent
|
const chart = e.firstChild.textContent
|
||||||
if (e.firstElementChild) {
|
if (e.firstElementChild) {
|
||||||
e.parentElement.parentElement.remove()
|
e.parentElement.remove()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (chart) {
|
if (chart) {
|
||||||
e.parentElement.parentElement.innerHTML = `<div class="mermaid">${chart}</div>`
|
e.parentElement.innerHTML = `<div class="mermaid">${chart}</div>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,6 +87,19 @@ function renderPrismMac() {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('代码渲染', err)
|
console.log('代码渲染', err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add pre-mac element for Mac Style UI
|
||||||
|
if (codeToolBars) {
|
||||||
|
Array.from(codeToolBars).forEach(item => {
|
||||||
|
const existPreMac = item.getElementsByClassName('pre-mac')
|
||||||
|
if (existPreMac.length < codeToolBars.length) {
|
||||||
|
const preMac = document.createElement('div')
|
||||||
|
preMac.classList.add('pre-mac')
|
||||||
|
preMac.innerHTML = '<span></span><span></span><span></span>'
|
||||||
|
item?.appendChild(preMac, item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PrismMac
|
export default PrismMac
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "notion-next",
|
"name": "notion-next",
|
||||||
"version": "3.6.0",
|
"version": "3.6.1",
|
||||||
"homepage": "https://github.com/tangly1024/NotionNext.git",
|
"homepage": "https://github.com/tangly1024/NotionNext.git",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const Slug = props => {
|
|||||||
const router = Router.useRouter()
|
const router = Router.useRouter()
|
||||||
|
|
||||||
// 文章锁🔐
|
// 文章锁🔐
|
||||||
const [lock, setLock] = React.useState(true)
|
const [lock, setLock] = React.useState(post?.password && post?.password !== '')
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (post?.password && post?.password !== '') {
|
if (post?.password && post?.password !== '') {
|
||||||
|
|||||||
@@ -67,4 +67,9 @@ pre[class*='language-'] {
|
|||||||
|
|
||||||
.notion-code-copy{
|
.notion-code-copy{
|
||||||
display: none;
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre[class*="language-mermaid"] {
|
||||||
|
background: transparent !important;
|
||||||
|
@apply dark:bg-gray-200 !important;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user