File tree 1 file changed +11
-2
lines changed
themes/nobelium/components
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,13 @@ import Link from 'next/link'
2
2
import { siteConfig } from '@/lib/config'
3
3
import { checkContainHttp , sliceUrlFromHttp } from '@/lib/utils'
4
4
import NotionIcon from '@/components/NotionIcon'
5
+ import NotionPage from '@/components/NotionPage'
5
6
6
7
const BlogPost = ( { post } ) => {
7
8
const url = checkContainHttp ( post . slug ) ? sliceUrlFromHttp ( post . slug ) : `${ siteConfig ( 'SUB_PATH' , '' ) } /${ post . slug } `
8
9
10
+ const showPreview = siteConfig ( 'POST_LIST_PREVIEW' ) && post . blockMap
11
+
9
12
return (
10
13
( < Link href = { url } >
11
14
@@ -19,9 +22,15 @@ const BlogPost = ({ post }) => {
19
22
</ time >
20
23
</ header >
21
24
< main >
22
- < p className = "hidden md:block leading-8 text-gray-700 dark:text-gray-300" >
25
+ { ! showPreview && < p className = "hidden md:block leading-8 text-gray-700 dark:text-gray-300" >
23
26
{ post . summary }
24
- </ p >
27
+ </ p > }
28
+ { showPreview && post ?. blockMap && (
29
+ < div className = "overflow-ellipsis truncate" >
30
+ < NotionPage post = { post } />
31
+ < hr className = 'border-dashed py-4' />
32
+ </ div >
33
+ ) }
25
34
</ main >
26
35
</ article >
27
36
You can’t perform that action at this time.
0 commit comments