File tree Expand file tree Collapse file tree 5 files changed +9
-2988
lines changed Expand file tree Collapse file tree 5 files changed +9
-2988
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ import Layout from '@/components/layout';
4
4
5
5
import 'prismjs/themes/prism-tomorrow.css' ;
6
6
import 'katex/dist/katex.min.css' ;
7
+
7
8
import '@/assets/styles/index.css' ;
8
- import '@/assets/styles/ notion-x .css' ;
9
+ import 'notion-to-jsx/dist/index .css' ;
9
10
10
11
const App = ( { Component, pageProps } : AppProps ) => {
11
12
return (
Original file line number Diff line number Diff line change 1
1
import { GetStaticProps } from 'next' ;
2
- import { NotionRenderer } from 'react- notion-x ' ;
2
+ import { NotionBlock , Renderer } from 'notion-to-jsx ' ;
3
3
4
- import { ExtendedRecordMap as EmbeddedRecordMap } from '@/interfaces/notion' ;
5
- import { getPage } from '@/utils' ;
4
+ import { notionClient } from '@/utils' ;
6
5
7
6
import PageHead from '@/components/common/PageHead' ;
8
7
9
8
import { REVALIDATE_TIME } from '@/assets/constants' ;
10
9
11
10
interface Props {
12
- recordMap : EmbeddedRecordMap ;
11
+ blocks : NotionBlock [ ] ;
13
12
}
14
13
15
- const AboutPage = ( { recordMap } : Props ) => {
14
+ const AboutPage = ( { blocks } : Props ) => {
16
15
return (
17
16
< >
18
17
< PageHead title = "About" />
19
- < article >
20
- < NotionRenderer
21
- recordMap = { recordMap as Parameters < typeof NotionRenderer > [ 0 ] [ 'recordMap' ] }
22
- />
23
- </ article >
18
+ < Renderer blocks = { blocks } />
24
19
</ >
25
20
) ;
26
21
} ;
@@ -32,11 +27,10 @@ export const getStaticProps: GetStaticProps<Props> = async () => {
32
27
33
28
if ( ! aboutId ) throw new Error ( 'NOTION_ABOUT_ID is not defined' ) ;
34
29
35
- const recordMap = await getPage ( aboutId ) ;
36
-
30
+ const blocks = ( await notionClient . getPageBlocks ( aboutId ) ) as NotionBlock [ ] ;
37
31
return {
38
32
props : {
39
- recordMap ,
33
+ blocks ,
40
34
} ,
41
35
revalidate : REVALIDATE_TIME ,
42
36
} ;
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import PageHead from '@/components/common/PageHead';
10
10
11
11
import { REVALIDATE_TIME } from '@/assets/constants' ;
12
12
13
- import 'notion-to-jsx/dist/index.css' ;
14
13
interface Props {
15
14
blocks : NotionBlock [ ] ;
16
15
seo : {
Original file line number Diff line number Diff line change @@ -10,45 +10,3 @@ body {
10
10
11
11
min-width : 360px ;
12
12
}
13
-
14
- .notion-page {
15
- padding-bottom : calc (max (5vh , 32px )) !important ;
16
- line-height : 1.65 ;
17
- }
18
-
19
- .notion-text {
20
- padding : 0.5em 2px ;
21
- }
22
-
23
- .notion-page-cover-wrapper ,
24
- .notion-page-cover-wrapper span ,
25
- .notion-page-cover-wrapper img {
26
- max-width : 1200px !important ;
27
- border-radius : 24px ;
28
- }
29
-
30
- .notion-collection-page-properties {
31
- display : none !important ;
32
- }
33
-
34
- @media only screen and (max-width : 1200px ) {
35
- .notion-page-cover-wrapper ,
36
- .notion-page-cover-wrapper span ,
37
- .notion-page-cover-wrapper img {
38
- border-radius : 0 ;
39
- }
40
- }
41
-
42
- @media (min-width : 1300px ) and (min-height : 300px ) {
43
- .notion-page-content-has-aside {
44
- width : calc ((97vw + var (--notion-max-width )) / 2 );
45
- }
46
- }
47
-
48
- .notion-page-cover-wrapper {
49
- box-shadow : 2px 2px 8px 4px rgba (15 , 15 , 15 , 0.1 );
50
- }
51
-
52
- .notion-aside-table-of-contents-header {
53
- display : none;
54
- }
You can’t perform that action at this time.
0 commit comments