diff --git a/components/ArticleCopyright.js b/components/ArticleCopyright.js
new file mode 100644
index 00000000..d2063055
--- /dev/null
+++ b/components/ArticleCopyright.js
@@ -0,0 +1,26 @@
+import { useGlobal } from '@/lib/global'
+import Link from 'next/link'
+
+export default function ArticleCopyright ({ author, url }) {
+ const { locale } = useGlobal()
+ return
+ {locale.COMMON.COPYRIGHT}
+
+ -
+ {locale.COMMON.AUTHOR}:
+
+ {author}
+
+
+ -
+ {locale.COMMON.URL}:
+
+ {url}
+
+
+ -
+ {locale.COMMON.COPYRIGHT_NOTICE}
+
+
+
+}
diff --git a/components/ArticleDetail.js b/components/ArticleDetail.js
index c7f9a011..9a055ffd 100644
--- a/components/ArticleDetail.js
+++ b/components/ArticleDetail.js
@@ -25,6 +25,7 @@ import { faEye, faFolderOpen } from '@fortawesome/free-solid-svg-icons'
import BlogAround from '@/components/BlogAround'
import { useRef } from 'react'
import WordCount from './WordCount'
+import ArticleCopyright from './ArticleCopyright'
/**
*
@@ -36,7 +37,7 @@ export default function ArticleDetail ({ post, blockMap, recommendPosts, prev, n
const drawerRight = useRef(null)
const url = BLOG.link + useRouter().asPath
const { locale } = useGlobal()
- const date = formatDate(post?.date?.start_date || post.createdTime, BLOG.lang)
+ const date = formatDate(post?.date?.start_date || post.createdTime, locale.LOCALE)
return (<>
@@ -134,27 +135,7 @@ export default function ArticleDetail ({ post, blockMap, recommendPosts, prev, n
{/* 版权声明 */}
-
- 版权声明
-
- -
- 本文作者:{' '}
-
- {BLOG.author}
-
-
- -
- 本文链接:{' '}
-
- {url}
-
-
- -
- 本博客所有文章除特别声明外,均采用 BY-NC-SA
- 许可协议。转载请注明出处!
-
-
-
+
{/* 标签列表 */}
diff --git a/components/BlogPostListScroll.js b/components/BlogPostListScroll.js
index 351c4927..b10b70a4 100644
--- a/components/BlogPostListScroll.js
+++ b/components/BlogPostListScroll.js
@@ -4,6 +4,7 @@ import BLOG from '@/blog.config'
import React, { useCallback, useEffect, useRef, useState } from 'react'
import throttle from 'lodash.throttle'
import BlogPostListEmpty from '@/components/BlogPostListEmpty'
+import { useGlobal } from '@/lib/global'
/**
* 博客列表滚动分页
@@ -47,6 +48,7 @@ const BlogPostListScroll = ({ posts = [], tags, currentSearch, currentCategory,
})
const targetRef = useRef(null)
+ const { locale } = useGlobal()
if (!postsToShow || postsToShow.length === 0) {
return
@@ -65,7 +67,7 @@ const BlogPostListScroll = ({ posts = [], tags, currentSearch, currentCategory,
handleGetMore()
}}
className='w-full my-4 py-4 text-center cursor-pointer glassmorphism shadow-xl rounded-xl dark:text-gray-200'
- > {hasMore ? '继续加载' : '加载完了😰'}
+ > {hasMore ? locale.COMMON.MORE : `${locale.COMMON.NO_MORE} 😰`}
}
diff --git a/components/DarkModeButton.js b/components/DarkModeButton.js
index c4df5e3c..ae344cf1 100644
--- a/components/DarkModeButton.js
+++ b/components/DarkModeButton.js
@@ -5,6 +5,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
const DarkModeButton = () => {
const { changeTheme } = useGlobal()
const userTheme = loadUserThemeFromCookies()
+
// 用户手动设置主题
const handleChangeDarkMode = () => {
const newTheme = (userTheme === 'light' ? 'dark' : 'light')
diff --git a/components/FloatDarkModeButton.js b/components/FloatDarkModeButton.js
index e09b79c3..53e28513 100644
--- a/components/FloatDarkModeButton.js
+++ b/components/FloatDarkModeButton.js
@@ -25,6 +25,10 @@ export default function FloatDarkModeButton () {
const newTheme = userTheme === 'light' ? 'dark' : 'light'
saveTheme(newTheme)
changeTheme(newTheme)
+ const htmlElement = document.getElementsByTagName('html')[0]
+ console.log('切换主题', htmlElement)
+ htmlElement.classList.remove(userTheme)
+ htmlElement.classList.add(newTheme)
}
return (
diff --git a/components/SideArea.js b/components/SideAreaLeft.js
similarity index 74%
rename from components/SideArea.js
rename to components/SideAreaLeft.js
index 828a3ea1..13ed6d51 100644
--- a/components/SideArea.js
+++ b/components/SideAreaLeft.js
@@ -21,28 +21,25 @@ import React from 'react'
* @returns {JSX.Element}
* @constructor
*/
-const SideArea = ({ title, tags, currentTag, post, posts, categories, currentCategory, currentSearch }) => {
+const SideAreaLeft = ({ title, tags, currentTag, post, posts, categories, currentCategory, currentSearch }) => {
const { locale } = useGlobal()
+ const showToc = post && post.toc && post.toc.length > 1
+ return <>
- return