diff --git a/themes/medium/components/ArticleAround.js b/themes/medium/components/ArticleAround.js index 45477653..95b6f83f 100644 --- a/themes/medium/components/ArticleAround.js +++ b/themes/medium/components/ArticleAround.js @@ -28,5 +28,5 @@ export default function ArticleAround ({ prev, next }) { - ); + ) } diff --git a/themes/simple/LayoutSlug.js b/themes/simple/LayoutSlug.js index 6b46a1a2..6cf7c82b 100644 --- a/themes/simple/LayoutSlug.js +++ b/themes/simple/LayoutSlug.js @@ -3,9 +3,10 @@ import { ArticleLock } from './components/ArticleLock' import NotionPage from '@/components/NotionPage' import { ArticleInfo } from './components/ArticleInfo' import Comment from '@/components/Comment' +import ArticleAround from './components/ArticleAround' export const LayoutSlug = props => { - const { post, lock, validPassword } = props + const { post, lock, validPassword, prev, next } = props if (!post) { return @@ -21,6 +22,7 @@ export const LayoutSlug = props => { {post && <> + {post.type === 'Post' && } } } diff --git a/themes/simple/components/ArticleAround.js b/themes/simple/components/ArticleAround.js new file mode 100644 index 00000000..b4cee232 --- /dev/null +++ b/themes/simple/components/ArticleAround.js @@ -0,0 +1,32 @@ +import Link from 'next/link' + +/** + * 上一篇,下一篇文章 + * @param {prev,next} param0 + * @returns + */ +export default function ArticleAround({ prev, next }) { + if (!prev || !next) { + return <> + } + return ( +
+ {prev && + + {prev.title} + + } + {next && + {next.title} + + + } +
+ ) +}