File tree 7 files changed +500
-369
lines changed
7 files changed +500
-369
lines changed Original file line number Diff line number Diff line change 10
10
"start" : " next start"
11
11
},
12
12
"dependencies" : {
13
- "next" : " ^9.3.5 " ,
13
+ "next" : " ^9.5.3 " ,
14
14
"node-fetch" : " ^2.6.0" ,
15
15
"react" : " ^16.13.1" ,
16
16
"react-dom" : " ^16.13.1" ,
Original file line number Diff line number Diff line change
1
+ import React from "react" ;
1
2
import { NotionRenderer , BlockMapType } from "react-notion" ;
2
3
import Head from "next/head" ;
4
+ import Link from "next/link" ;
3
5
import fetch from "node-fetch" ;
4
6
5
7
export async function getServerSideProps ( context ) {
@@ -39,7 +41,15 @@ const NotionPage = ({ blockMap }) => {
39
41
< Head >
40
42
< title > { title } </ title >
41
43
</ Head >
42
- < NotionRenderer blockMap = { blockMap } fullPage />
44
+ < NotionRenderer
45
+ blockMap = { blockMap }
46
+ fullPage
47
+ customBlockComponents = { {
48
+ page : ( { blockValue, renderComponent } ) => (
49
+ < Link href = { `/${ blockValue . id } ` } > { renderComponent ( ) } </ Link >
50
+ )
51
+ } }
52
+ />
43
53
< style jsx global > { `
44
54
div :global(.notion-code) {
45
55
box-sizing: border-box;
Original file line number Diff line number Diff line change 1
1
import { NotionRenderer , BlockMapType } from "react-notion" ;
2
2
import Head from "next/head" ;
3
+ import Link from "next/link" ;
3
4
import fetch from "node-fetch" ;
4
5
5
6
export async function getStaticProps ( ) {
@@ -26,7 +27,14 @@ const Home = ({ blockMap }) => (
26
27
< Head >
27
28
< title > react-notion example</ title >
28
29
</ Head >
29
- < NotionRenderer blockMap = { blockMap } />
30
+ < NotionRenderer
31
+ blockMap = { blockMap }
32
+ customBlockComponents = { {
33
+ page : ( { blockValue, renderComponent } ) => (
34
+ < Link href = { `/${ blockValue . id } ` } > { renderComponent ( ) } </ Link >
35
+ )
36
+ } }
37
+ />
30
38
</ div >
31
39
) ;
32
40
Original file line number Diff line number Diff line change @@ -3310,7 +3310,7 @@ next-tick@~1.0.0:
3310
3310
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
3311
3311
integrity sha1-yobR/ogoFpsBICCOPchCS524NCw=
3312
3312
3313
- next@^9.3.5 :
3313
+ next@^9.5.3 :
3314
3314
version "9.5.3"
3315
3315
resolved "https://registry.yarnpkg.com/next/-/next-9.5.3.tgz#7af5270631f98d330a7f75a6e8e1ac202aa155e2"
3316
3316
integrity sha512-DGrpTNGV2RNMwLaSzpgbkbaUuVk30X71/roXHS10isSXo2Gm+qWcjonDyOxf1KmOvHZRHA/Fa+LaAR7ysdYS3A==
You can’t perform that action at this time.
0 commit comments