Content is read live through a Cloudflare Worker. The browser never sees your Notion token.
Local npm run sync is optional (writes /data/*.json fallback if the Worker is down or NOTION_API_BASE is empty).
- Create an integration at https://www.notion.so/my-integrations
- Create Projects, Blogs, and Books databases (schemas below)
- Share each database with the integration (⋯ → Connections)
- Copy the token and three database IDs
| Property | Type |
|---|---|
| Name | Title |
| Description | Rich text |
| Tags | Multi-select |
| Site URL | URL |
| Github URL | URL (optional) |
| Image / Image URL | Files or URL |
| Featured | Checkbox |
| Order | Number |
| Published | Checkbox |
| Property | Type |
|---|---|
| Name | Title |
| Slug | Rich text |
| Summary | Rich text |
| Date | Date |
| Cover | Files (optional) |
| Published | Checkbox |
| Property | Type |
|---|---|
| Name | Title |
| Author | Rich text |
| Status | Select |
| Cover | Files (optional) |
| Notes | Rich text |
| Order | Number |
| Published | Checkbox |
cd workers/notion-api
npm install
npx wrangler login
npx wrangler secret put NOTION_TOKEN
npx wrangler secret put NOTION_PROJECTS_DB_ID
npx wrangler secret put NOTION_BLOGS_DB_ID
npx wrangler secret put NOTION_BOOKS_DB_ID
npx wrangler deployWorker routes:
GET /projectsGET /booksGET /blogsGET /blogs/:slug(full post HTML)GET /health
CORS allows https://abkaaar.github.io and http://localhost:4321. Responses use Cache-Control: public, max-age=60.
Edit js/config.js:
window.NOTION_API_BASE = 'https://abkaaar-notion.YOUR_SUBDOMAIN.workers.dev';Push to main so GitHub Pages picks it up.
NOTION_TOKEN=secret_...
NOTION_PROJECTS_DB_ID=...
NOTION_BLOGS_DB_ID=...
NOTION_BOOKS_DB_ID=...
npm run sync # writes data/*.json
npm run dev- Edit Notion (toggle Published)
- Wait up to ~60 seconds (Worker cache) or hard-refresh
- Site updates — no
git pushrequired for content
Site shell/CSS/JS changes still need a normal commit + push to GitHub Pages.
node scripts/seed-notion-projects.mjs