├── .gitignore
├── .idea
├── .gitignore
├── fumadocs-notion.iml
├── inspectionProfiles
│ └── Project_Default.xml
├── modules.xml
├── prettier.xml
└── vcs.xml
├── LICENSE
├── README.md
├── app
├── (home)
│ ├── layout.tsx
│ └── page.tsx
├── api
│ └── search
│ │ └── route.ts
├── docs
│ ├── [id]
│ │ ├── page.tsx
│ │ └── renderer.tsx
│ ├── layout.tsx
│ └── page.tsx
├── global.css
├── layout.config.tsx
└── layout.tsx
├── lib
└── notion.ts
├── next.config.mjs
├── notion-settings.png
├── package.json
├── pnpm-lock.yaml
├── postcss.config.js
├── tailwind.config.js
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # deps
2 | /node_modules
3 |
4 | # generated content
5 | .contentlayer
6 | .content-collections
7 | .source
8 |
9 | # test & build
10 | /coverage
11 | /.next/
12 | /out/
13 | /build
14 | *.tsbuildinfo
15 |
16 | # misc
17 | .DS_Store
18 | *.pem
19 | /.pnp
20 | .pnp.js
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 | # others
26 | .env*.local
27 | .vercel
28 | next-env.d.ts
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 |
--------------------------------------------------------------------------------
/.idea/fumadocs-notion.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/prettier.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Fuma Nama
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## fumadocs-notion
2 |
3 | This is an example Fumadocs app that works with Notion.
4 |
5 | ### Setup
6 |
7 | Create a Notion integration on https://www.notion.so/profile/integrations, select the correct workspace, and add your
8 | secret to `.env.local` after creation.
9 |
10 | ```
11 | NOTION_API_KEY=secret
12 | ```
13 |
14 | You can now connect certain pages to the integration, from the page menu:
15 |
16 | 
17 |
18 | Find your integration name here and connect it to your page.
19 |
20 | After adding pages, run development server:
21 |
22 | ```bash
23 | pnpm dev
24 | ```
25 |
26 | Open http://localhost:3000 with your browser to see the result.
27 |
28 | ### How it works?
29 |
30 | This app uses the Notion API to fetch pages and implement search functionality, and with `react-notion-x` to render page
31 | content in React.
32 |
33 | Feel free to take a look in the example for details.
34 |
35 | ### Supported Features
36 |
37 | The example is relatively simple, it only supports simple block types, and do not support the full functionality of
38 | database.
39 |
40 | Dynamic rendering can also be enabled by setting `revalidate` segment config in `/app/docs/[id]/page.tsx`, like:
41 |
42 | ```tsx
43 | export const revalidate = 4000
44 | ```
--------------------------------------------------------------------------------
/app/(home)/layout.tsx:
--------------------------------------------------------------------------------
1 | import type {ReactNode} from 'react';
2 | import {HomeLayout} from 'fumadocs-ui/layouts/home';
3 | import {baseOptions} from '@/app/layout.config';
4 |
5 | export default function Layout({children}: {
6 | children: ReactNode;
7 | }) {
8 | return {children};
15 | }
16 |
--------------------------------------------------------------------------------
/app/(home)/page.tsx:
--------------------------------------------------------------------------------
1 | import Link from 'next/link';
2 |
3 | export default async function HomePage() {
4 | return (
5 |
6 |
Hello World
7 |
8 | You can open{' '}
9 |
13 | /docs
14 | {' '}
15 | and see the documentation.
16 |