π A Next.js static blog platform using Notion as CMS
A personal static blog that uses Notion as a content management system and generates fast, SEO-optimized static HTML files for deployment anywhere.
- Notion CMS Integration: Use Notion as your blog editor and content manager
- Categories & Tags: Organize posts with systematic classification
- Multi-language Support: Korean/English UI support (ko-KR, en-US)
- Static Generation: All content pre-built at compile time
- Dark/Light Mode: Theme switching with system settings integration
- Responsive Design: Mobile-first design optimized for all devices
- Fast Search: Client-side search functionality
- Comment System: Utterances integration support
- Static Site Export: Ultra-fast loading with pre-generated HTML
- Auto Sitemap: Automatic sitemap.xml and RSS feed generation
- Canonical URLs: SEO-optimized URLs with trailing slashes
- Image Optimization: Optimized Notion image handling
- Google Analytics: Built-in analytics support
- Next.js 15 - React framework with static export
- TypeScript - Type safety and better development experience
- Emotion - CSS-in-JS styling system
- Notion API - Content management and data source
- react-notion-x - Notion block rendering
- Prism.js - Syntax highlighting for code blocks
- Mermaid - Diagram and flowchart rendering
- Node.js 20+
- npm or yarn package manager
- Notion account with a database page
git clone https://github.com/HaJunYoo/notion-log.git
cd notion-log
npm installCreate a .env.local file with the required variables:
# Required
NOTION_PAGE_ID=your_notion_database_page_id
# Optional - Analytics
NEXT_PUBLIC_GOOGLE_MEASUREMENT_ID=your_ga_measurement_id
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION=your_google_verification
# Optional - Comments
NEXT_PUBLIC_UTTERANCES_REPO=your_github_repoEdit site.config.js with your information:
const CONFIG = {
profile: {
name: "Your Name",
image: "/notion-avatar.svg",
role: "Developer",
bio: "Your bio here",
email: "your.email@example.com",
// Add your social links
},
blog: {
title: "Your Blog Title",
description: "Your blog description",
}
// ... other settings
}# Build static files
npm run build
# Serve locally to test
npx serve outThe static files will be generated in the out/ directory, ready for deployment.
# Development
npm run dev # Start development server (http://localhost:3000)
npm run build # Build static files for production
npm run lint # Run ESLint code linting
# Utilities
npm run postbuild # Generate sitemap and RSS (runs automatically after build)
npm run generate-rss # Generate RSS feed onlymake build # Build static files (npx next build)
make local # Serve built files locally (npx serve out)
make install # Install dependencies (npm install)βββ src/
β βββ apis/ # Notion API client
β βββ components/ # Reusable UI components
β βββ hooks/ # Custom React hooks
β βββ layouts/ # Layout components
β βββ libs/ # Utility libraries
β βββ pages/ # Next.js pages and routes
β βββ routes/ # Main route components
β βββ styles/ # Theme and style system
β βββ types/ # TypeScript definitions
βββ scripts/ # Build and utility scripts
βββ public/ # Static assets
βββ out/ # Generated static files (after build)
βββ site.config.js # Blog configuration
-
Create a Notion Database
- Create a new page in Notion
- Add a database with these properties:
- Title (Title)
- Status (Select: Published, Draft)
- Category (Select)
- Tags (Multi-select)
- Date (Date)
-
Get Your Database ID
- Share your database publicly or get the page ID from the URL
- Add the ID to your
.env.localfile asNOTION_PAGE_ID
This blog generates static files that can be deployed anywhere:
- Connect your GitHub repository
- Build command:
npm run build - Output directory:
out - Add environment variables in dashboard
- Netlify: Same build settings as Cloudflare Pages
- Vercel: Works with static export settings
- GitHub Pages: Upload
out/directory contents - AWS S3: Upload
out/directory as static website
npm run build # Generate static files
# Upload contents of 'out/' directory to your hosting providerPlease register bug reports or feature suggestions in Issues.
MIT License - see LICENSE file for details.
This project is based on morethan-log. Thanks for the excellent work.
π Live Demo | π Documentation
Made with by HaJunYoo