This is a personal blog built with Next.js, MDX, Tailwind CSS, and Emotion.
- Write blog posts in Markdown/MDX with front-matter (
title,tags,published_at, optionalimage) - Responsive styling with Tailwind CSS and Emotion
- Code syntax highlighting using Prism.js (
prism-react-renderer) - SEO optimization with
next-seoand dynamic Open Graph tags - Automatically generated sitemap and
robots.txt - Google Analytics integration
- Deploy easily on Vercel (formerly ZEIT Now)
- Node.js v10 or newer
- Yarn or npm
- Clone the repository:
git clone https://github.com/wawoon/blog.git cd blog - Install dependencies:
yarn install # or npm install - Run the development server:
yarn dev # or npm run dev - Open http://localhost:3000 in your browser.
yarn build
yarn start
# or with npm:
npm run build
npm run start.
├── components/ Shared React components
│ └── posts/ Components for blog posts
├── layouts/ MDX layouts (default post layout)
├── lib/ Utility functions (e.g., date formatting)
├── post_data/ MDX front-matter parsing and sorting
├── pages/ Next.js pages, including `posts/` and API routes
├── public/ Static assets (robots.txt, favicon, etc.)
├── tailwind.config.js Tailwind CSS configuration
├── babel-plugin-macros.config.js Babel configuration for Tailwind macros
├── next.config.js Next.js configuration with MDX support
├── now.json Vercel (Now) deployment configuration
├── package.json Project metadata and scripts
└── tsconfig.json TypeScript configuration
Create a new .md or .mdx file under pages/posts/ with YAML front-matter:
---
title: "My New Post"
tags: "tag1 tag2"
published_at: "2021-01-01"
image: "/assets/image.png" # optional
---
Write your post content here in Markdown or MDX...The now.json file is configured for easy deployment on Vercel.
Simply run:
vercelMIT © Yoshinori Kosaka