A modern blog built with Next.js 16, TypeScript, and Tailwind CSS. Write posts in Markdown, push to deploy.
| Technology | Role |
|---|---|
| Next.js 16 | React framework with App Router + SSG |
| TypeScript | Type safety |
| Tailwind CSS + Typography | Styling |
| unified / rehype-highlight | Markdown → HTML with syntax highlighting |
| highlight.js (github-dark) | Code block theme |
| gray-matter | Frontmatter parsing |
| date-fns | Date formatting |
app/
layout.tsx # Root layout (header/footer)
page.tsx # Home page
globals.css # Global styles + code block theme
blog/
page.tsx # Blog listing
[slug]/page.tsx # Individual post
about/page.tsx # About page
components/
Header.tsx
Footer.tsx
PostCard.tsx
PostContent.tsx # Client component — renders HTML + copy buttons
lib/
posts.ts # Markdown processing (unified pipeline)
posts/ # Your blog posts (.md files)
npm install
npm run devOpen http://localhost:3000.
Create a .md file in posts/:
---
title: "Your Post Title"
date: "2024-02-15"
excerpt: "Brief description shown on post cards"
tags: ["Python", "Performance"]
author: "Your Name"
---
Content in Markdown here. Code blocks get syntax highlighting automatically:
\`\`\`python
def hello():
print("Hello, world!")
\`\`\`Each code block has a Copy button in the top-right corner.
| What | Where |
|---|---|
| Site title & description | app/layout.tsx → metadata |
| Bio | app/about/page.tsx |
| Social links | components/Footer.tsx |
| Primary color palette | tailwind.config.js → colors.primary |
Connect your GitHub repo at vercel.com — zero config needed.
-
Uncomment and update
basePath/assetPrefixinnext.config.js:basePath: '/your-repo-name', assetPrefix: '/your-repo-name',
-
Push to
main— the includeddeploy.ymlworkflow builds and deploys automatically. -
Enable Pages in repo Settings → Pages → Source: GitHub Actions.
Your site will be live at https://yourusername.github.io/your-repo-name.
# Write
code posts/new-post.md
# Preview
npm run dev
# Deploy
git add posts/new-post.md
git commit -m "Add: post title"
git pushnpm run dev # Start dev server
npm run build # Build for production
npm run lint # Run ESLintModule not found errors
rm -rf node_modules package-lock.json && npm installDeployment fails on GitHub Pages
- Check the Actions tab for error details
- Ensure
basePathinnext.config.jsmatches your repo name exactly - Confirm Pages is enabled under Settings → Pages