diff --git a/blog.config.js b/blog.config.js index 926b4f8a..90167ec0 100644 --- a/blog.config.js +++ b/blog.config.js @@ -1,6 +1,6 @@ const BLOG = { - title: '唐力1024', - author: '唐力', + title: '塘里1024', + author: '塘里', email: 'tlyong1992@hotmail.com', link: 'https://tangly1024.com', description: '分享有趣的技术与思考', diff --git a/components/BlogPostCard.js b/components/BlogPostCard.js index dd5bc69d..140b27da 100644 --- a/components/BlogPostCard.js +++ b/components/BlogPostCard.js @@ -5,7 +5,7 @@ import React from 'react' const BlogPostCard = ({ post }) => { return ( -
+
{/* 封面图 */} {post.page_cover && post.page_cover.length > 1 && ( diff --git a/components/BlogPostListScroll.js b/components/BlogPostListScroll.js index 1b8d396e..20c05bfb 100644 --- a/components/BlogPostListScroll.js +++ b/components/BlogPostListScroll.js @@ -67,7 +67,7 @@ const BlogPostListScroll = ({ posts = [], tags, currentSearch, currentCategory, {currentTag && (
-
# {currentTag}
+
{currentTag}
)} diff --git a/components/Comment.js b/components/Comment.js index 450a2791..c376d704 100644 --- a/components/Comment.js +++ b/components/Comment.js @@ -27,8 +27,6 @@ const Comment = ({ frontMatter }) => { const { theme } = useGlobal() return
-
留下评论
- {/* 评论插件 */} {BLOG.comment.provider === 'gitalk' && ( { const { locale } = useGlobal() const [show, switchShow] = useState(false) const [percent, changePercent] = useState(0) - const scrollListener = useCallback(throttle(() => { + const scrollListener = () => { // 处理是否显示回到顶部按钮 const clientHeight = targetRef ? (targetRef.current ? targetRef.current.clientHeight : 0) : 0 const scrollY = window.pageYOffset @@ -26,7 +26,7 @@ const JumpToTop = ({ targetRef, showPercent = true }) => { let per = parseFloat(((scrollY / fullHeight * 100)).toFixed(0)) if (per > 100) per = 100 changePercent(per) - }, 100)) + } useEffect(() => { document.addEventListener('scroll', scrollListener) return () => document.removeEventListener('scroll', scrollListener) diff --git a/components/Progress.js b/components/Progress.js index 30ac21d4..f6899eb8 100644 --- a/components/Progress.js +++ b/components/Progress.js @@ -8,7 +8,7 @@ import throttle from 'lodash.throttle' */ const Progress = ({ targetRef }) => { const [percent, changePercent] = useState(0) - const scrollListener = useCallback(throttle(() => { + const scrollListener = () => { if (targetRef.current) { const clientHeight = targetRef ? (targetRef.current.clientHeight) : 0 const scrollY = window.pageYOffset @@ -17,7 +17,7 @@ const Progress = ({ targetRef }) => { if (per > 100) per = 100 changePercent(per) } - }, 100)) + } useEffect(() => { document.addEventListener('scroll', scrollListener) diff --git a/components/RewardButton.js b/components/RewardButton.js index 62f72d6b..1e6de761 100644 --- a/components/RewardButton.js +++ b/components/RewardButton.js @@ -39,18 +39,19 @@ const RewardButton = () => {
diff --git a/components/ShareBar.js b/components/ShareBar.js index c2b1942a..215646dc 100644 --- a/components/ShareBar.js +++ b/components/ShareBar.js @@ -32,6 +32,7 @@ const ShareBar = ({ post }) => { return <>
+
分享本文:
diff --git a/components/TagItem.js b/components/TagItem.js index 532bfdbf..88499c53 100644 --- a/components/TagItem.js +++ b/components/TagItem.js @@ -2,12 +2,10 @@ import Link from 'next/link' const TagItem = ({ tag }) => ( - -

- {tag} -

-
+
{tag}
+
) diff --git a/components/TagItemMini.js b/components/TagItemMini.js index 6a0c2927..01f3a857 100644 --- a/components/TagItemMini.js +++ b/components/TagItemMini.js @@ -2,13 +2,13 @@ import Link from 'next/link' const TagItemMini = ({ tag, selected = false, count }) => ( - - {tag + (count ? `(${count})` : '')} - +
+
{tag + (count ? `(${count})` : '')}
+
) diff --git a/pages/article/[slug].js b/pages/article/[slug].js index bc1aa5d2..9c36f133 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -3,18 +3,17 @@ import BLOG from '@/blog.config' import { getPageTableOfContents } from 'notion-utils' import { useRouter } from 'next/router' import Progress from '@/components/Progress' -import Image from 'next/image' import TagItem from '@/components/TagItem' import formatDate from '@/lib/formatDate' import { Code, Collection, CollectionRow, Equation, NotionRenderer } from 'react-notion-x' import RewardButton from '@/components/RewardButton' import ShareBar from '@/components/ShareBar' -import BlogPostCardMini from '@/components/BlogPostCardMini' import Comment from '@/components/Comment' import TocBar from '@/components/TocBar' import BaseLayout from '@/layouts/BaseLayout' import React, { useRef } from 'react' import Custom404 from '@/pages/404' +import Link from 'next/link' import 'prismjs/themes/prism-okaidia.css' import 'prismjs' @@ -40,10 +39,9 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories }) const url = BLOG.link + useRouter().asPath return - {/* 阅读进度条 */} -
+
{/* 中央区域 wrapper */}
@@ -54,8 +52,7 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories }) )}
-
+
{/* 文章标题 */}

{post.title} @@ -68,7 +65,12 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories }) {/* 文章作者等关联信息 */}
-
{post.category}
+
+ 发表于: +
+ +
{post.category}
+ {post.type[0] !== 'Page' && (
@@ -78,15 +80,6 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories }) )}
)} - - {post.tags && ( -
- {post.tags.map(tag => ( - - ))} -
- )} -
{/* 不蒜子 */} @@ -98,7 +91,7 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories })

-
+
{/* Notion文章主体 */} {blockMap && ( -
+
+
+ - 💖 本 文 结 束 😚 感 谢 您 的 阅 读 💖 - +
+
+ 打赏一杯咖啡~ +
+
-

- - 💖 本 文 结 束 😚 感 谢 您 的 阅 读 💖 - -

{/* 版权声明 */}
-
-
分享本文 
- +
+ + {post.tags && ( +
+
标签:
+ {post.tags.map(tag => ( + + ))} +
+ )} + +
+ +
+
-
其他文章
+
- - +
{prev.title}
+
{next.title}
- {/* 评论互动 */} - + {/* 评论互动 */} +
+ +
+
{/* 右侧目录 */} diff --git a/public/reward_code.jpg b/public/reward_code.jpg deleted file mode 100755 index 18820ae1..00000000 Binary files a/public/reward_code.jpg and /dev/null differ diff --git a/public/reward_code_alipay.png b/public/reward_code_alipay.png new file mode 100644 index 00000000..5b1f4a00 Binary files /dev/null and b/public/reward_code_alipay.png differ diff --git a/public/reward_code_wechat.png b/public/reward_code_wechat.png new file mode 100755 index 00000000..26853fcf Binary files /dev/null and b/public/reward_code_wechat.png differ