diff --git a/components/BlogAround.js b/components/BlogAround.js new file mode 100644 index 00000000..4bd6c3a6 --- /dev/null +++ b/components/BlogAround.js @@ -0,0 +1,23 @@ +import Link from 'next/link' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faAngleDoubleLeft, faAngleDoubleRight } from '@fortawesome/free-solid-svg-icons' + +/** + * 上一篇,下一篇文章 + * @param {prev,next} param0 + * @returns + */ +export default function BlogAround ({ prev, next }) { + return
+ +
+ {prev.title} +
+ + +
{next.title} + +
+ +
+} diff --git a/components/TocDrawer.js b/components/TocDrawer.js index 6fe0de6d..9f161edb 100644 --- a/components/TocDrawer.js +++ b/components/TocDrawer.js @@ -29,7 +29,7 @@ const TocDrawer = ({ post, cRef }) => { ' dark:border-gray-800 bg-white dark:bg-gray-700 shadow-xl animate__animated animate__faster max-h-96 ' + ' w-60 duration-200 fixed right-4 top-16 rounded overflow-y-auto'}> {post && <> -
+
{locale.COMMON.TABLE_OF_CONTENTS}
diff --git a/pages/article/[slug].js b/pages/article/[slug].js index 1167a0af..1f03857e 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -27,7 +27,8 @@ import TocDrawerButton from '@/components/TocDrawerButton' import { useGlobal } from '@/lib/global' import { getNotionPageData } from '@/lib/notion/getNotionData' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faAngleDoubleLeft, faAngleDoubleRight, faEye, faFolderOpen } from '@fortawesome/free-solid-svg-icons' +import { faEye, faFolderOpen } from '@fortawesome/free-solid-svg-icons' +import BlogAround from '@/components/BlogAround' const mapPageUrl = id => { return 'https://www.notion.so/' + id.replace(/-/g, '') @@ -53,9 +54,9 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories
-
+
-
+
{post.type && !post.type.includes('Page') && (<>
1) ? post.page_cover : BLOG.defaultImgCover} loading='eager' objectFit='cover' layout='fill' alt={post.title} /> @@ -84,6 +85,10 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories
+
+ {post.summary} +
+ {/* Notion文章主体 */} {blockMap && ( - + -
-
- -
- {prev.title}
- - -
{next.title} - -
- -
-
+ {/* 评论互动 */}