mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-30 07:26:45 +00:00
自定义js/css 自定义代码主题
This commit is contained in:
@@ -18,6 +18,9 @@ const ExternalScript = () => {
|
||||
loadExternalResource(url, 'css')
|
||||
}
|
||||
}
|
||||
// 静态导入本地自定义样式
|
||||
loadExternalResource('/css/custom.css', 'css')
|
||||
loadExternalResource('/js/custom.js', 'js')
|
||||
}, [])
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ const Pdf = dynamic(
|
||||
// https://github.com/txs
|
||||
// import PrismMac from '@/components/PrismMac'
|
||||
const PrismMac = dynamic(() => import('@/components/PrismMac'), {
|
||||
ssr: false
|
||||
ssr: true
|
||||
})
|
||||
|
||||
const Collection = dynamic(() =>
|
||||
|
||||
@@ -10,12 +10,20 @@ import 'prismjs/plugins/line-numbers/prism-line-numbers.css'
|
||||
import 'prismjs/plugins/autoloader/prism-autoloader'
|
||||
// mermaid图
|
||||
import BLOG from '@/blog.config'
|
||||
import { isBrowser, loadExternalResource } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
* @author https://github.com/txs/
|
||||
* @returns
|
||||
*/
|
||||
const PrismMac = () => {
|
||||
if (isBrowser()) {
|
||||
loadExternalResource(BLOG.PRISM_THEME_PATH, 'css')
|
||||
if (BLOG.CODE_MAC_BAR) {
|
||||
loadExternalResource('/css/prism-mac-style.css', 'css')
|
||||
}
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
renderPrismMac()
|
||||
renderMermaid()
|
||||
|
||||
Reference in New Issue
Block a user