diff --git a/themes/example/components/ArticleLock.js b/themes/example/components/ArticleLock.js
index a9f5f59d..43b6647e 100644
--- a/themes/example/components/ArticleLock.js
+++ b/themes/example/components/ArticleLock.js
@@ -8,14 +8,12 @@ import { useGlobal } from '@/lib/global'
* @returns
*/
export const ArticleLock = props => {
- const { password, validPassword } = props
+ const { validPassword } = props
const { locale } = useGlobal()
const submitPassword = () => {
const p = document.getElementById('password')
- if (p && p.value && p.value === password) {
- validPassword(true)
- } else {
+ if (!validPassword(p?.value)) {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
diff --git a/themes/example/components/ExampleRecentComments.js b/themes/example/components/ExampleRecentComments.js
index 32d11463..e1fe86ca 100644
--- a/themes/example/components/ExampleRecentComments.js
+++ b/themes/example/components/ExampleRecentComments.js
@@ -1,7 +1,7 @@
import React from 'react'
-import { RecentComments } from '@waline/client'
import BLOG from '@/blog.config'
import Link from 'next/link'
+import { RecentComments } from '@waline/client'
/**
* @see https://waline.js.org/guide/get-started.html
diff --git a/themes/example/components/SideBar.js b/themes/example/components/SideBar.js
index 0e737fa3..ea45f851 100644
--- a/themes/example/components/SideBar.js
+++ b/themes/example/components/SideBar.js
@@ -2,7 +2,8 @@ import BLOG from '@/blog.config'
import Live2D from '@/components/Live2D'
import { useGlobal } from '@/lib/global'
import Link from 'next/link'
-import ExampleRecentComments from './ExampleRecentComments'
+import dynamic from 'next/dynamic'
+const ExampleRecentComments = dynamic(() => import('./ExampleRecentComments'))
export const SideBar = (props) => {
const { locale } = useGlobal()
diff --git a/themes/fukasawa/LayoutSlug.js b/themes/fukasawa/LayoutSlug.js
index 30265a6c..fb78690c 100644
--- a/themes/fukasawa/LayoutSlug.js
+++ b/themes/fukasawa/LayoutSlug.js
@@ -1,19 +1,13 @@
-import { getPageTableOfContents } from 'notion-utils'
import ArticleDetail from './components/ArticleDetail'
import LayoutBase from './LayoutBase'
import { ArticleLock } from './components/ArticleLock'
export const LayoutSlug = (props) => {
- const { post, lock, validPassword } = props
- if (!lock && post?.blockMap?.block) {
- post.content = Object.keys(post.blockMap.block)
- post.toc = getPageTableOfContents(post, post.blockMap)
- }
-
+ const { lock, validPassword } = props
return (
{!lock && }
- {lock && }
+ {lock && }
)
}
diff --git a/themes/fukasawa/components/ArticleLock.js b/themes/fukasawa/components/ArticleLock.js
index 23112eeb..8ae18a4e 100644
--- a/themes/fukasawa/components/ArticleLock.js
+++ b/themes/fukasawa/components/ArticleLock.js
@@ -8,14 +8,12 @@ import { useGlobal } from '@/lib/global'
* @returns
*/
export const ArticleLock = props => {
- const { password, validPassword } = props
+ const { validPassword } = props
const { locale } = useGlobal()
const submitPassword = () => {
const p = document.getElementById('password')
- if (p && p.value && p.value === password) {
- validPassword(true)
- } else {
+ if (!validPassword(p?.value)) {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
diff --git a/themes/hexo/LayoutArchive.js b/themes/hexo/LayoutArchive.js
index 5f30f76e..8d2a1c08 100644
--- a/themes/hexo/LayoutArchive.js
+++ b/themes/hexo/LayoutArchive.js
@@ -39,7 +39,7 @@ export const LayoutArchive = (props) => {
}, [])
return
-
+
{Object.keys(archivePosts).map(archiveTitle => (
{
const { post, lock, validPassword } = props
+ const drawerRight = useRef(null)
if (!post) {
return {
>
}
- if (!lock && post?.blockMap?.block) {
- post.content = Object.keys(post.blockMap.block)
- post.toc = getPageTableOfContents(post, post.blockMap)
- }
-
- const drawerRight = useRef(null)
const targetRef = isBrowser() ? document.getElementById('container') : null
const floatSlot = <>
@@ -53,7 +47,7 @@ export const LayoutSlug = props => {
floatSlot={floatSlot}
>
- {lock &&
}
+ {lock &&
}
{!lock &&
diff --git a/themes/hexo/components/ArticleLock.js b/themes/hexo/components/ArticleLock.js
index 84ef905f..1a1bd193 100644
--- a/themes/hexo/components/ArticleLock.js
+++ b/themes/hexo/components/ArticleLock.js
@@ -8,13 +8,11 @@ import { useGlobal } from '@/lib/global'
* @returns
*/
export const ArticleLock = props => {
- const { password, validPassword } = props
+ const { validPassword } = props
const { locale } = useGlobal()
const submitPassword = () => {
const p = document.getElementById('password')
- if (p && p.value && p.value === password) {
- validPassword(true)
- } else {
+ if (!validPassword(p?.value)) {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
diff --git a/themes/hexo/components/HeaderArticle.js b/themes/hexo/components/HeaderArticle.js
index 918c75c7..8ebfe2bd 100644
--- a/themes/hexo/components/HeaderArticle.js
+++ b/themes/hexo/components/HeaderArticle.js
@@ -4,12 +4,13 @@ import formatDate from '@/lib/formatDate'
import BLOG from '@/blog.config'
export default function HeaderArticle({ post, siteInfo }) {
+ const { locale } = useGlobal()
+
if (!post) {
return <>>
}
const headerImage = post?.page_cover ? `url("${post.page_cover}")` : `url("${siteInfo?.pageCover}")`
- const { locale } = useGlobal()
const date = formatDate(
post?.date?.start_date || post?.createdTime,
locale.LOCALE
diff --git a/themes/hexo/components/HexoRecentComments.js b/themes/hexo/components/HexoRecentComments.js
index 4977ccf4..d4cbacab 100644
--- a/themes/hexo/components/HexoRecentComments.js
+++ b/themes/hexo/components/HexoRecentComments.js
@@ -1,9 +1,9 @@
import React from 'react'
-import { RecentComments } from '@waline/client'
import BLOG from '@/blog.config'
import Card from '@/themes/hexo/components/Card'
import { useGlobal } from '@/lib/global'
import Link from 'next/link'
+import { RecentComments } from '@waline/client'
/**
* @see https://waline.js.org/guide/get-started.html
diff --git a/themes/hexo/components/InfoCard.js b/themes/hexo/components/InfoCard.js
index 3b28d0fa..1393211a 100644
--- a/themes/hexo/components/InfoCard.js
+++ b/themes/hexo/components/InfoCard.js
@@ -14,7 +14,7 @@ export function InfoCard (props) {
}}
>
{/* eslint-disable-next-line @next/next/no-img-element */}
-

+
{BLOG.AUTHOR}
{BLOG.BIO}
diff --git a/themes/hexo/components/NavButtonGroup.js b/themes/hexo/components/NavButtonGroup.js
index 7a71ee02..f15b992d 100644
--- a/themes/hexo/components/NavButtonGroup.js
+++ b/themes/hexo/components/NavButtonGroup.js
@@ -16,7 +16,7 @@ const NavButtonGroup = (props) => {
return
diff --git a/themes/hexo/components/SideRight.js b/themes/hexo/components/SideRight.js
index 8079fb2d..8680f144 100644
--- a/themes/hexo/components/SideRight.js
+++ b/themes/hexo/components/SideRight.js
@@ -6,9 +6,10 @@ import Catalog from './Catalog'
import { InfoCard } from './InfoCard'
import { AnalyticsCard } from './AnalyticsCard'
import CONFIG_HEXO from '../config_hexo'
-import HexoRecentComments from './HexoRecentComments'
import BLOG from '@/blog.config'
+import dynamic from 'next/dynamic'
+const HexoRecentComments = dynamic(() => import('./HexoRecentComments'))
/**
* Hexo主题右侧栏
* @param {*} props
diff --git a/themes/medium/LayoutCategory.js b/themes/medium/LayoutCategory.js
index a3018144..7522e264 100644
--- a/themes/medium/LayoutCategory.js
+++ b/themes/medium/LayoutCategory.js
@@ -5,7 +5,7 @@ import BLOG from '@/blog.config'
export const LayoutCategory = props => {
const { category } = props
- const slotTop =
+ const slotTop =
return
{BLOG.POST_LIST_STYLE === 'page' ? : }
diff --git a/themes/medium/LayoutSlug.js b/themes/medium/LayoutSlug.js
index f7fdc4d0..bdeec1a5 100644
--- a/themes/medium/LayoutSlug.js
+++ b/themes/medium/LayoutSlug.js
@@ -1,5 +1,3 @@
-import { getPageTableOfContents } from 'notion-utils'
-
import LayoutBase from './LayoutBase'
import { useGlobal } from '@/lib/global'
import React from 'react'
@@ -16,11 +14,6 @@ export const LayoutSlug = props => {
/>
}
- if (!lock && post?.blockMap?.block) {
- post.content = Object.keys(post.blockMap.block)
- post.toc = getPageTableOfContents(post, post.blockMap)
- }
-
const slotRight = post?.toc && post?.toc?.length > 3 && (
@@ -29,7 +22,7 @@ export const LayoutSlug = props => {
return (
- {!lock ? : }
+ {!lock ? : }
)
}
diff --git a/themes/medium/LayoutTag.js b/themes/medium/LayoutTag.js
index 6f072aa9..41164ce3 100644
--- a/themes/medium/LayoutTag.js
+++ b/themes/medium/LayoutTag.js
@@ -5,7 +5,7 @@ import BlogPostListPage from './components/BlogPostListPage'
export const LayoutTag = (props) => {
const { tag } = props
- const slotTop =
+ const slotTop =
return
{BLOG.POST_LIST_STYLE === 'page' ? : }
diff --git a/themes/medium/components/ArticleDetail.js b/themes/medium/components/ArticleDetail.js
index 1fffc2a0..660cc1e1 100644
--- a/themes/medium/components/ArticleDetail.js
+++ b/themes/medium/components/ArticleDetail.js
@@ -36,7 +36,7 @@ export const ArticleDetail = props => {
{/* eslint-disable-next-line @next/next/no-img-element */}
-

+
{BLOG.AUTHOR}
diff --git a/themes/medium/components/ArticleLock.js b/themes/medium/components/ArticleLock.js
index 4b969835..1e1bb228 100644
--- a/themes/medium/components/ArticleLock.js
+++ b/themes/medium/components/ArticleLock.js
@@ -8,14 +8,12 @@ import { useGlobal } from '@/lib/global'
* @returns
*/
export const ArticleLock = props => {
- const { password, validPassword } = props
+ const { validPassword } = props
const { locale } = useGlobal()
const submitPassword = () => {
const p = document.getElementById('password')
- if (p && p.value && p.value === password) {
- validPassword(true)
- } else {
+ if (!validPassword(p?.value)) {
const tips = document.getElementById('tips')
if (tips) {
tips.innerHTML = ''
diff --git a/themes/medium/components/InfoCard.js b/themes/medium/components/InfoCard.js
index ce3f7bc3..f34b2ee6 100644
--- a/themes/medium/components/InfoCard.js
+++ b/themes/medium/components/InfoCard.js
@@ -9,7 +9,7 @@ const InfoCard = (props) => {
{ Router.push('/about') }}>
{/* eslint-disable-next-line @next/next/no-img-element */}
-

+
{BLOG.AUTHOR}
{BLOG.BIO}
diff --git a/themes/next/LayoutArchive.js b/themes/next/LayoutArchive.js
index ce66e25f..3db36dbd 100644
--- a/themes/next/LayoutArchive.js
+++ b/themes/next/LayoutArchive.js
@@ -39,7 +39,7 @@ export const LayoutArchive = (props) => {
return (
-
+
{Object.keys(archivePosts).map(archiveTitle => (
{
const { allPosts, categories } = props
const { locale } = useGlobal()
return
-
+
{locale.COMMON.CATEGORY}:
diff --git a/themes/next/LayoutSlug.js b/themes/next/LayoutSlug.js
index aa1cc4d2..fa1915a1 100644
--- a/themes/next/LayoutSlug.js
+++ b/themes/next/LayoutSlug.js
@@ -1,4 +1,3 @@
-import { getPageTableOfContents } from 'notion-utils'
import TocDrawerButton from './components/TocDrawerButton'
import LayoutBase from './LayoutBase'
import Card from './components/Card'
@@ -12,11 +11,6 @@ import { isBrowser } from '@/lib/utils'
export const LayoutSlug = (props) => {
const { post, latestPosts, lock, validPassword } = props
- if (!lock && post?.blockMap?.block) {
- post.content = Object.keys(post.blockMap.block)
- post.toc = getPageTableOfContents(post, post.blockMap)
- }
-
const drawerRight = useRef(null)
const targetRef = isBrowser() ? document.getElementById('container') : null
const floatSlot = post?.toc?.length > 1
@@ -45,7 +39,7 @@ export const LayoutSlug = (props) => {
{!lock &&
}
- {lock &&
}
+ {lock &&
}
{/* 悬浮目录按钮 */}
diff --git a/themes/next/LayoutTagIndex.js b/themes/next/LayoutTagIndex.js
index d7fae64e..45100a9e 100644
--- a/themes/next/LayoutTagIndex.js
+++ b/themes/next/LayoutTagIndex.js
@@ -6,7 +6,7 @@ export const LayoutTagIndex = (props) => {
const { tags } = props
const { locale } = useGlobal()
return
-