Skip to content

Commit

Permalink
修复3.16.0编译打包问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Jun 27, 2023
1 parent e18fe02 commit 562cb61
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ assignees: tangly1024
- 操作系统: [例如. iOS, Android, macOS, windows]
- 浏览器 [例如. chrome, safari, firefox]
- NotionNext版本 [e.g. 3.13.6]
- 主题 [例如. hexo]

**补充说明**
与问题相关的其它说明
2 changes: 1 addition & 1 deletion components/NotionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const NotionPage = ({ post, className }) => {
Tweet
}} />

<PrismMac />
<PrismMac/>

</div>
}
Expand Down
16 changes: 9 additions & 7 deletions components/PrismMac.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { useEffect } from 'react'
'use client'

import { useEffect } from 'react'
import Prism from 'prismjs'
// 所有语言的prismjs 使用autoloader引入
// import 'prismjs/plugins/autoloader/prism-autoloader'
Expand All @@ -12,7 +14,7 @@ import 'prismjs/plugins/line-numbers/prism-line-numbers.css'
// mermaid图
import BLOG from '@/blog.config'
import { isBrowser, loadExternalResource } from '@/lib/utils'
import { useRouter } from 'next/router'
import { useRouter } from 'next/navigation'

/**
* @author https://github.com/txs/
Expand All @@ -27,7 +29,6 @@ const PrismMac = () => {
}
loadExternalResource(BLOG.PRISM_THEME_PATH, 'css')
loadExternalResource(BLOG.PRISM_JS_AUTO_LOADER, 'js').then((url) => {
// console.log('渲染公式图表')
if (window?.Prism?.plugins?.autoloader) {
window.Prism.plugins.autoloader.languages_path = BLOG.PRISM_JS_PATH
}
Expand Down Expand Up @@ -63,10 +64,11 @@ const renderMermaid = async() => {
}
}
if (needLoad) {
const url = await loadExternalResource(BLOG.MERMAID_CDN, 'js')
const mermaid = window.mermaid
console.log('mermaid加载成功', url, mermaid)
mermaid.contentLoaded()
loadExternalResource(BLOG.MERMAID_CDN, 'js').then(url => {
// console.log('mermaid加载成功', url, mermaid)
const mermaid = window.mermaid
mermaid.contentLoaded()
})
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/notion/getNotionData.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function getGlobalNotionData({
* @returns
*/
function getLatestPosts({ allPages, from, latestPostCount }) {
const allPosts = allPages.filter(page => page.type === 'Post' && page.status === 'Published')
const allPosts = allPages?.filter(page => page.type === 'Post' && page.status === 'Published')

const latestPosts = Object.create(allPosts).sort((a, b) => {
const dateA = new Date(a?.lastEditedTime || a?.createdTime || a?.date?.start_date)
Expand Down

0 comments on commit 562cb61

Please sign in to comment.