rotion 3.0.0-rc.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +63 -0
- package/README.md +63 -0
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -176,6 +176,69 @@ const db = await FetchDatabase({ database_id: 'YOUR_DATABASE_ID' })
|
|
|
176
176
|
- `Checkbox` - チェックボックスの表示
|
|
177
177
|
- `createClientLink` - Next.js App Router用ヘルパー(v2.0.1以降)
|
|
178
178
|
|
|
179
|
+
サンプル
|
|
180
|
+
--
|
|
181
|
+
|
|
182
|
+
`examples/` ディレクトリには、Notionデータベース連携を実演する完全なサンプルが含まれています。
|
|
183
|
+
|
|
184
|
+
### データベースのセットアップ
|
|
185
|
+
|
|
186
|
+
すべてのサンプルは、以下のプロパティを持つNotionデータベースが必要です:
|
|
187
|
+
|
|
188
|
+
| プロパティ名 | プロパティ型 |
|
|
189
|
+
|------------|-------------|
|
|
190
|
+
| Title | `title` |
|
|
191
|
+
| Tags | `multi_select`|
|
|
192
|
+
| Date | `date` |
|
|
193
|
+
|
|
194
|
+
### [nextjs-approuter](./examples/nextjs-approuter)
|
|
195
|
+
データベース対応のNext.js App Routerサンプル:
|
|
196
|
+
- インデックスページにデータベーステーブルビュー
|
|
197
|
+
- 個別記事用の動的 `[id]` ルート
|
|
198
|
+
- `generateStaticParams` を使ったServer Components
|
|
199
|
+
- CSS Modulesによるスタイリング
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
cd examples/nextjs-approuter
|
|
203
|
+
cp .env.example .env.local
|
|
204
|
+
# NOTION_TOKENとNOTION_DATABASE_IDを設定
|
|
205
|
+
npm install
|
|
206
|
+
npm run dev
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### [nextjs-pagerouter](./examples/nextjs-pagerouter)
|
|
210
|
+
データベース対応のNext.js Pages Routerサンプル:
|
|
211
|
+
- `getStaticProps` を使ったデータベーステーブルビュー
|
|
212
|
+
- `getStaticPaths` による動的 `[id]` ルート
|
|
213
|
+
- 従来のSSGワークフロー
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
cd examples/nextjs-pagerouter
|
|
217
|
+
cp .env.example .env.local
|
|
218
|
+
# NOTION_TOKENとNOTION_DATABASE_IDを設定
|
|
219
|
+
npm install
|
|
220
|
+
npm run dev
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### [astro](./examples/astro)
|
|
224
|
+
データベース対応のAstroサンプル:
|
|
225
|
+
- `.astro` ファイルでのデータベーステーブルビュー
|
|
226
|
+
- `getStaticPaths` による動的ルート
|
|
227
|
+
- `client:load` によるReactコンポーネント
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
cd examples/astro
|
|
231
|
+
cp .env.example .env
|
|
232
|
+
# NOTION_TOKENとNOTION_DATABASE_IDを設定
|
|
233
|
+
npm install
|
|
234
|
+
npm run dev
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
各サンプルのデモ内容:
|
|
238
|
+
- 3つのプロパティすべてを表示するデータベーステーブルビュー
|
|
239
|
+
- 完全なコンテンツを持つ個別記事ページ
|
|
240
|
+
- データベースと記事ビュー間のナビゲーション
|
|
241
|
+
|
|
179
242
|
スクリプト
|
|
180
243
|
--
|
|
181
244
|
|
package/README.md
CHANGED
|
@@ -175,6 +175,69 @@ Main Exports
|
|
|
175
175
|
- `Checkbox` – Renders checkboxes
|
|
176
176
|
- `createClientLink` – Helper for Next.js App Router (v2.0.1+)
|
|
177
177
|
|
|
178
|
+
Examples
|
|
179
|
+
--
|
|
180
|
+
|
|
181
|
+
The `examples/` directory contains complete working examples demonstrating Notion database integration.
|
|
182
|
+
|
|
183
|
+
### Database Setup
|
|
184
|
+
|
|
185
|
+
All examples require a Notion database with the following properties:
|
|
186
|
+
|
|
187
|
+
| Property Name | Property Type |
|
|
188
|
+
|--------------|---------------|
|
|
189
|
+
| Title | `title` |
|
|
190
|
+
| Tags | `multi_select`|
|
|
191
|
+
| Date | `date` |
|
|
192
|
+
|
|
193
|
+
### [nextjs-approuter](./examples/nextjs-approuter)
|
|
194
|
+
Next.js App Router example with database support:
|
|
195
|
+
- Database table view on the index page
|
|
196
|
+
- Dynamic `[id]` routes for individual articles
|
|
197
|
+
- Server Components with `generateStaticParams`
|
|
198
|
+
- CSS Modules for styling
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
cd examples/nextjs-approuter
|
|
202
|
+
cp .env.example .env.local
|
|
203
|
+
# Add your NOTION_TOKEN and NOTION_DATABASE_ID
|
|
204
|
+
npm install
|
|
205
|
+
npm run dev
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### [nextjs-pagerouter](./examples/nextjs-pagerouter)
|
|
209
|
+
Next.js Pages Router example with database support:
|
|
210
|
+
- Database table view using `getStaticProps`
|
|
211
|
+
- Dynamic `[id]` routes with `getStaticPaths`
|
|
212
|
+
- Traditional SSG workflow
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
cd examples/nextjs-pagerouter
|
|
216
|
+
cp .env.example .env.local
|
|
217
|
+
# Add your NOTION_TOKEN and NOTION_DATABASE_ID
|
|
218
|
+
npm install
|
|
219
|
+
npm run dev
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### [astro](./examples/astro)
|
|
223
|
+
Astro example with database support:
|
|
224
|
+
- Database table view in `.astro` files
|
|
225
|
+
- Dynamic routes with `getStaticPaths`
|
|
226
|
+
- React components with `client:load`
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
cd examples/astro
|
|
230
|
+
cp .env.example .env
|
|
231
|
+
# Add your NOTION_TOKEN and NOTION_DATABASE_ID
|
|
232
|
+
npm install
|
|
233
|
+
npm run dev
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Each example demonstrates:
|
|
237
|
+
- Database table view displaying all three properties
|
|
238
|
+
- Individual article pages with full content
|
|
239
|
+
- Navigation between database and article views
|
|
240
|
+
|
|
178
241
|
Scripts
|
|
179
242
|
--
|
|
180
243
|
|