From 6562b6a341f1b4af4fa03a0f9b09423748ae6a18 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Mon, 1 Nov 2021 14:48:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9C=E9=97=B4=E6=A8=A1=E5=BC=8F=E9=80=82?= =?UTF-8?q?=E9=85=8D=EF=BC=8C=E7=A7=BB=E9=99=A4react-canvas-nest,CPU?= =?UTF-8?q?=E6=B6=88=E8=80=97=E6=9C=89=E7=82=B9=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/BlogPost.js | 10 ++++------ components/BlogPostListScroll.js | 2 +- components/Logo.js | 2 +- layouts/BaseLayout.js | 5 +---- package.json | 1 - pages/article/[slug].js | 30 ++++++++++++++++-------------- 6 files changed, 23 insertions(+), 27 deletions(-) diff --git a/components/BlogPost.js b/components/BlogPost.js index 9b5f9e69..c94e3376 100644 --- a/components/BlogPost.js +++ b/components/BlogPost.js @@ -4,8 +4,7 @@ import Link from 'next/link' const BlogPost = ({ post }) => { return ( -
+
{/* 封面图 */} {post.page_cover && post.page_cover.length > 1 && ( @@ -14,9 +13,8 @@ const BlogPost = ({ post }) => { )}
- - {post.title} + +
{post.title}
{post.tags.map(tag => ())} @@ -24,7 +22,7 @@ const BlogPost = ({ post }) => {

{post.summary}

-
+ ) } diff --git a/components/BlogPostListScroll.js b/components/BlogPostListScroll.js index d6484df0..76a88e9e 100644 --- a/components/BlogPostListScroll.js +++ b/components/BlogPostListScroll.js @@ -66,7 +66,7 @@ const BlogPostListScroll = ({ posts = [], tags }) => { if (!postsToShow || postsToShow.length === 0) { return } else { - return
+ return
{/* 文章列表 */}
diff --git a/components/Logo.js b/components/Logo.js index 929cdc91..43e8e130 100644 --- a/components/Logo.js +++ b/components/Logo.js @@ -4,7 +4,7 @@ import React from 'react' const Logo = () => { return -
+
Tangly 1024
diff --git a/layouts/BaseLayout.js b/layouts/BaseLayout.js index e1e8f1ad..a9de65ff 100644 --- a/layouts/BaseLayout.js +++ b/layouts/BaseLayout.js @@ -8,7 +8,6 @@ import TopNav from '@/components/TopNav' import Footer from '@/components/Footer' import SideBar from '@/components/SideBar' import JumpToTop from '@/components/JumpToTop' -import ReactCanvasNest from 'react-canvas-nest' const BaseLayout = ({ children, layout, fullWidth, tags, meta, post, ...customMeta }) => { let windowTop = 0 @@ -37,11 +36,10 @@ const BaseLayout = ({ children, layout, fullWidth, tags, meta, post, ...customMe return (
- {/* Middle Wrapper */} -
+
{children} @@ -50,7 +48,6 @@ const BaseLayout = ({ children, layout, fullWidth, tags, meta, post, ...customMe
-
) } diff --git a/package.json b/package.json index dde5b7e4..0789c1f3 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "preact": "^10.5.13", "qrcode.react": "^1.0.1", "react": "17.0.2", - "react-canvas-nest": "^1.1.1", "react-cusdis": "^2.0.1", "react-dom": "17.0.2", "react-notion-x": "^4.6.5", diff --git a/pages/article/[slug].js b/pages/article/[slug].js index f007514b..5d17cb18 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -35,7 +35,7 @@ const BlogPost = ({ post, blockMap, tags, prev, next }) => { {/* 阅读进度条 */} -
+
{/* 中央区域 wrapper */}
@@ -47,7 +47,7 @@ const BlogPost = ({ post, blockMap, tags, prev, next }) => {
+ className='w-screen md:w-full overflow-x-auto md:px-10 px-5 py-10 max-w-5xl mx-auto dark:border-gray-700 dark:bg-gray-700'> {/* 文章标题 */}

{post.title} @@ -92,17 +92,19 @@ const BlogPost = ({ post, blockMap, tags, prev, next }) => {

- {/* Notion文章主体 */} - {blockMap && ( - - )} +
+ {/* Notion文章主体 */} + {blockMap && ( + + )} +
@@ -142,7 +144,7 @@ const BlogPost = ({ post, blockMap, tags, prev, next }) => { {/* 右侧目录 */}