A Next.js-based personal website with Notion integration for content management.
- 📝 Content managed in Notion
- 🔄 Automatic export to Markdown
- 🎨 Modern design with Tailwind CSS
- 🔍 Full-text search functionality
- 🏷️ Tag-based organization
- 💬 Disqus comments integration
- 📱 Responsive design
npm install --legacy-peer-depsRun the interactive setup:
npm run setup-notionOr manually create a .env file:
cp .env.example .env
# Edit .env and add your NOTION_TOKENSee NOTION_INTEGRATION.md for detailed setup instructions.
npm run fetch-postsnpm run devOpen http://localhost:3000 to view your site.
├── scripts/ # Notion integration scripts
│ ├── fetchNotionPosts.js # Main export script (JavaScript)
│ ├── fetchNotionPosts.ts # TypeScript version
│ ├── setup.js # Interactive setup
│ └── checkEnv.js # Environment checker
├── content/ # Exported markdown files
├── public/
│ └── files/ # Downloaded images
├── data/
│ └── search.json # Search index
├── pages/ # Next.js pages
├── components/ # React components
└── lib/ # Utility functions
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run fetch-posts- Fetch and export posts from Notionnpm run setup-notion- Interactive Notion setupnpm run check-env- Validate environment variables
Your Notion database should include:
| Property | Type | Description |
|---|---|---|
| title | Title | Post title |
| public | Checkbox | Publish status |
| tags | Multi-select | Post tags |
| published date | Date | Publication date |
| section | Select | Content section (Blog/Projects) |
| id | Formula | Generated unique ID |
- Write content in Notion
- Check the "public" checkbox when ready
- Run
npm run fetch-posts - Content is exported to
/contentas markdown - Images are downloaded to
/public/files - Site automatically picks up new content
- Text formatting (bold, italic, code, links)
- Headings (H1, H2, H3)
- Lists (bulleted, numbered, to-do)
- Code blocks with syntax highlighting
- Images (automatically downloaded)
- Tables
- Quotes & Callouts
- Dividers
- Bookmarks
- Framework: Next.js 12
- Styling: Tailwind CSS
- Content: Notion API → Markdown
- Comments: Disqus
- Search: Custom JSON index
- Deployment: Vercel (recommended)
This project previously used a Python-based Notion exporter. The JavaScript version offers:
- ✅ No Python dependency
- ✅ Official Notion SDK
- ✅ Better Next.js integration
- ✅ TypeScript support
- ✅ Easier deployment
The Python code is still available in /bin for reference.
Create a .env file:
# Required
NOTION_TOKEN=your_notion_integration_token
# Optional (has default)
NOTION_DATABASE_ID=your_database_idNever commit .env - it's in .gitignore.
- Push to GitHub
- Import project in Vercel
- Add
NOTION_TOKENto environment variables - Deploy!
Optional: Set up a cron job to run fetch-posts periodically.
- Build:
npm run build - Start:
npm run start - Set environment variables
- Schedule
npm run fetch-postsas needed
- Notion Integration Guide - Detailed setup and usage
- Scripts README - Technical details about export scripts
See NOTION_INTEGRATION.md for common issues and solutions.
MIT
Contributions are welcome! Please feel free to submit a Pull Request.