mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-17 23:16:50 +00:00
Merge branch 'main' of https://github.com/tangly1024/NotionNext into main
This commit is contained in:
@@ -43,6 +43,7 @@ const BLOG = {
|
||||
|
||||
// PrismJs CDN
|
||||
PRISM_JS_PATH: 'https://npm.elemecdn.com/prismjs@1.29.0/components/',
|
||||
CODE_LINE_NUMBERS: process.env.NEXT_PUBLIC_CODE_LINE_NUMBERS || 'false',
|
||||
|
||||
BACKGROUND_LIGHT: '#eeeeee', // use hex value, don't forget '#' e.g #fffefc
|
||||
BACKGROUND_DARK: '#000000', // use hex value, don't forget '#'
|
||||
|
||||
@@ -73,16 +73,17 @@ function renderPrismMac() {
|
||||
const container = document?.getElementById('container-inner')
|
||||
|
||||
// Add line numbers
|
||||
const codeBlocks = container?.getElementsByTagName('pre')
|
||||
if (codeBlocks) {
|
||||
Array.from(codeBlocks).forEach(item => {
|
||||
if (!item.classList.contains('line-numbers')) {
|
||||
item.classList.add('line-numbers')
|
||||
item.style.whiteSpace = 'pre-wrap'
|
||||
}
|
||||
})
|
||||
if (BLOG.CODE_LINE_NUMBERS === 'true') {
|
||||
const codeBlocks = container?.getElementsByTagName('pre')
|
||||
if (codeBlocks) {
|
||||
Array.from(codeBlocks).forEach(item => {
|
||||
if (!item.classList.contains('line-numbers')) {
|
||||
item.classList.add('line-numbers')
|
||||
item.style.whiteSpace = 'pre-wrap'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 重新渲染之前检查所有的多余text
|
||||
|
||||
try {
|
||||
|
||||
@@ -22,7 +22,7 @@ const Utterances = ({ issueTerm, layout }) => {
|
||||
script.setAttribute('crossorigin', 'anonymous')
|
||||
script.setAttribute('async', true)
|
||||
script.setAttribute('repo', BLOG.COMMENT_UTTERRANCES_REPO)
|
||||
script.setAttribute('issue-term', issueTerm)
|
||||
script.setAttribute('issue-term', 'title')
|
||||
script.setAttribute('theme', theme)
|
||||
anchor.appendChild(script)
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user