Skip to content

3omdawy/next-ssg-for-md-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

107 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Next.js SSG Blog Framework

Live Demo MIT License Next.js TypeScript Tailwind CSS

A modern, stable blog framework built with Next.js 16. Fork it, add your content, and you're ready to publish!

๐Ÿ”— Live Demo | ๐Ÿ“– Documentation | ๐Ÿ—๏ธ Architecture | โš–๏ธ Attributions Coverage ๐Ÿš€ Quick Start


๐ŸŽฏ What Is This?

This is a blog framework/template, not a finished blog. Think of it like:

  • ๐Ÿ—๏ธ Framework: The code that powers the blog (you don't need to touch this)
  • ๐Ÿ“ Your Content: Blog posts and assets (this is what you customize)

You customize: /content (your posts) + /public (your assets) + config.ts (your settings)
We provide: Everything else works out of the box!

๐Ÿ‘‰ See CUSTOMIZATION.md for the complete customization guide


๐Ÿ’ก Why I Built This

The Motivation

I needed a specific combination of features that I couldn't find in a single existing framework:

  • Simplicity: I wanted to start writing immediately without complex configuration.
  • RTL Support: I needed first-class support for Arabic content.
  • Embeddability: I needed to render blog posts inside other applications (dashboards), not just as a standalone site.
  • Ownership: I wanted to keep my content in standard Markdown/MDX to avoid lock-in.

The Solution

A minimalist blog framework that:

โœ… Works out of the box with sensible defaults
โœ… Fully static (no server required) for maximum performance
โœ… Pure markdown/MDX - own your content forever
โœ… Customizable everything via simple config files
โœ… Modern tech stack (Next.js 16, TypeScript, Tailwind v4)
โœ… Special Feature: Dual deployment modes (standalone + embeddable fragments)
โœ… Special Feature: First-class RTL language support

Who Is This For?

  • ๐Ÿ’ป Developers who want a simple, customizable technical blog
  • ๐Ÿ“ Writers who want to write in Markdown without overhead
  • ๐ŸŒ Multilingual authors needing robust RTL support
  • ๐Ÿข Teams needing to embed blog content into existing apps
  • ๐ŸŽ“ Educators organizing content into sequential series

โšก Performance Metrics

Lighthouse Scores (Production Build)

Lighthouse Scores on the main page

๐ŸŸข Performance:   95/100
๐ŸŸข Accessibility: 95/100
๐ŸŸข Best Practices: 96/100
๐ŸŸข SEO:          100/100

Build Metrics

  • Build Time: ~17.5 seconds (9 posts)
    • Measured using Measure-Command { cmd /c "npm run build:standalone" } on Windows
  • Bundle Size: ~195 kB total
  • Largest Contentful Paint: < 2.4s

Why So Fast?

  • โœ… 100% Static: No server-side rendering overhead
  • โœ… Optimized Images: Automatic image optimization
  • โœ… Code Splitting: Only load what you need
  • โœ… Tree Shaking: Unused code eliminated
  • โœ… Minimal JavaScript: Static HTML with progressive enhancement

โœจ Features

๐Ÿš€ Core Functionality

  • โœ… Markdown & MDX Support - Write content in .md or .mdx files
  • โœ… Static Site Generation - Pre-rendered HTML for optimal performance
  • โœ… Search Functionality - Fast, client-side search with Fuse.js
  • โœ… Series Support - Group related posts into series
  • โœ… Syntax Highlighting - Beautiful code blocks with highlight.js
  • โœ… GitHub Flavored Markdown - Tables, task lists, and more
  • โœ… Frontmatter Support - Rich metadata (title, date, tags, author, etc.)
  • โœ… Reading Time Estimation - Automatic calculation
  • โœ… Table of Contents - Auto-generated from headings
  • โœ… Draft Posts - Hide posts in production with draft: true

๐ŸŽจ Design & UX

  • โœ… Dark & Light Mode - Automatic theme switching with persistence
  • โœ… Responsive Design - Mobile-first approach
  • โœ… Modern Typography - Tailwind Typography plugin
  • โœ… Fully Customizable Theme - Easy color customization via CSS variables (MDB 5 based)
  • โœ… Smooth Transitions - Polished user experience
  • โœ… Single Post Conversion - Fast Markdown to HTML conversion script

๐ŸŒ Key Differentiators

1. Triple Deployment Modes โญ

  • Standalone Website - Full-featured blog with navigation system
  • Embeddable Content - Pure HTML fragments for custom CSS integration
  • Bootstrap-Compatible - Drop-in ready fragments for Bootstrap/MDB projects

Use Case: Build your blog once, embed articles anywhere (corporate dashboards, learning management systems, Bootstrap apps).

2. First-Class RTL Support โญ

  • โœ… Native Arabic and RTL language support
  • โœ… Per-post language control
  • โœ… Automatic direction detection
  • โœ… RTL-aware layouts

Use Case: Create multilingual blogs or Arabic-first content without complex CSS overrides.


๐Ÿ“ธ Screenshots

Light & Dark Mode

Light Mode Dark Mode
Homepage Light Homepage Dark

Key Features

๐Ÿ‘€ Expand to see more screenshots

Blog Post with Table of Contents

Blog Post

First-Class RTL Support (Arabic)

Arabic Post

Instant Search

Search

Series Navigation

Series


๐Ÿ“Š Comparison with Other Frameworks

Feature This Framework Gatsby Hugo Jekyll Astro
Focus Simplicity + RTL Ecosystem Speed Simplicity Performance
Setup Time < 5 min ~30 min ~15 min ~15 min ~10 min
TypeScript First โœ… โŒ โŒ โŒ โœ…
MDX Support โœ… โœ… (plugin) โŒ โŒ โœ…
RTL Support โœ… Native โŒ Manual โŒ Manual โŒ Manual โŒ Manual
Embeddable Mode โœ… Built-in โŒ โŒ โŒ โŒ
Series Navigation โœ… โŒ โŒ โŒ โŒ
Dark Mode โœ… Built-in โŒ Manual โŒ Manual โŒ Manual โœ… (some themes)
Search โœ… Client-side โœ… (plugin) โŒ โŒ โŒ Manual
Bundle Size ~70 kB ~200 kB ~50 kB ~100 kB ~80 kB
Learning Curve Low High Medium Low Medium

When to Choose This Framework?

  • โœ… You need RTL support out of the box
  • โœ… You need embeddable content for other apps
  • โœ… You prefer a Next.js/React stack
  • โœ… You value simplicity over a massive plugin ecosystem

๐Ÿš€ Quick Start (5 Minutes to Your Blog)

1. Fork & Clone

# Fork this repo on GitHub, then clone your fork
git clone https://github.com/YOUR-USERNAME/next-ssg-for-md-blog.git
cd next-ssg-for-md-blog

2. Install Dependencies

npm install

3. Customize Your Blog

# Edit site configuration
nano config.ts
export const config = {
  site: {
    name: process.env.SITE_NAME || "Your Blog Name", // โฌ…๏ธ CHANGE THIS
    description: process.env.SITE_DESCRIPTION || "Your description", // โฌ…๏ธ CHANGE THIS
    url: process.env.SITE_URL || "https://yourdomain.com", // โฌ…๏ธ CHANGE THIS
    author: "Your Name", // โฌ…๏ธ CHANGE THIS
  },
  language: "default", // 'ar' for RTL, 'ltr' for LTR, 'default' for auto-detect
  // ...
};

4. Add Your Content

# Remove example posts (or keep them as reference)
rm -rf content/blog/*

# Create your first post
nano content/blog/my-first-post.md
---
title: "My First Post"
date: "2026-01-07"
author: "Your Name"
tags: ["welcome"]
description: "My first blog post!"
---

## Hello World!

This is my first post using this awesome blog framework!

5. Run & Preview

npm run dev

Visit http://localhost:3000 - You're live! ๐ŸŽ‰

6. Deploy

# Build for production
npm run build

# Deploy to Vercel, Netlify, or any static host

๐Ÿ“‚ What to Customize

๐Ÿ”ด MUST CUSTOMIZE (3 things)

  1. /content/blog/ - Your blog posts (.md files)
  2. /public/ - Your images, favicon, assets
  3. config.ts - Your blog name, description, URL

๐ŸŸก SHOULD CUSTOMIZE (Make it yours)

  1. src/app/globals.css - Theme colors (line 16+)
  2. components/layout/Header.tsx - Navigation links

๐ŸŸข CAN CUSTOMIZE (Optional)

  1. Fonts, metadata, advanced features

๐Ÿ‘‰ Full customization guide: CUSTOMIZATION.md


๐Ÿ—๏ธ Project Structure

next-ssg-for-md-blog/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ CUSTOMIZE THESE (Your Content)
โ”‚   โ”œโ”€โ”€ content/              # Your blog posts & pages
โ”‚   โ”‚   โ”œโ”€โ”€ blog/            # .md files for blog posts
โ”‚   โ”‚   โ””โ”€โ”€ pages/           # .md files for static pages
โ”‚   โ”œโ”€โ”€ public/              # Images, favicon, static assets
โ”‚   โ””โ”€โ”€ config.ts            # Blog configuration
โ”‚
โ”œโ”€โ”€ ๐ŸŽจ CUSTOMIZE IF NEEDED (Styling)
โ”‚   โ”œโ”€โ”€ src/app/globals.css  # Theme colors
โ”‚   โ””โ”€โ”€ components/layout/   # Header, footer, navigation
โ”‚
โ””โ”€โ”€ โš™๏ธ DON'T MODIFY (Framework - works out of box)
    โ”œโ”€โ”€ src/app/             # Next.js pages & routing
    โ”œโ”€โ”€ components/blog/     # Blog components
    โ”œโ”€โ”€ lib/                 # Markdown processing, utilities
    โ”œโ”€โ”€ types/               # TypeScript types
    โ””โ”€โ”€ next.config.ts       # Next.js configuration

๐Ÿ“ Creating Content

Blog Post Template

Create a new file in content/blog/your-post-name.md or content/blog/your-post-name.mdx:

---
title: "Your Post Title"
date: "2026-01-07"
author: "Your Name"
tags: ["tag1", "tag2"]
category: "Category Name"
description: "A brief description for SEO"
language: "ar" # Optional: 'ar' for Arabic/RTL, 'en' for English/LTR
draft: false
---

## Your Content Here

Write your blog post content using markdown...

### Subheadings work great

- Lists are supported
- Including nested lists
  - Like this

Code blocks with syntax highlighting:

```javascript
console.log("Hello, world!");
```

And much more!


### Frontmatter Reference

| Field         | Type                | Required | Description                |
| ------------- | ------------------- | -------- | -------------------------- |
| `title`       | string              | โœ…       | Post title                 |
| `date`        | string (YYYY-MM-DD) | โœ…       | Publication date           |
| `author`      | string              | โŒ       | Author name                |
| `tags`        | string[]            | โŒ       | Post tags                  |
| `category`    | string              | โŒ       | Post category              |
| `description` | string              | โŒ       | SEO description            |
| `image`       | string              | โŒ       | Cover image path           |
| `language`    | string              | โŒ       | 'ar' for RTL, 'en' for LTR |
| `draft`       | boolean             | โŒ       | Hide in production         |
| `series`      | string              | โŒ       | Series name                |
| `seriesOrder` | number              | โŒ       | Order in series            |

### RTL Language Support

The blog supports Arabic and other RTL languages. See [docs/RTL_SUPPORT.md](./docs/RTL_SUPPORT.md) for details.

**Quick example:**

```yaml
---
title: "ู…ุฑุญุจุงู‹ ุจูƒ"
language: "ar" # This post will render in RTL
---

๐ŸŽจ Customizing Theme

Edit src/app/globals.css (around line 16):

@theme {
  /* Change these to your brand colors */
  --color-primary: #3b82f6; /* Links, CTAs */
  --color-accent: #8b5cf6; /* Accents, highlights */
  --color-background: #ffffff; /* Page background */
  --color-surface: #f8fafc; /* Cards, surfaces */
  /* ... more colors ... */
}

Popular themes:

  • Tech (current): Blue #3b82f6 + Purple #8b5cf6
  • Nature: Green #10b981 + Teal #14b8a6
  • Creative: Pink #ec4899 + Orange #f97316

See full color customization in CUSTOMIZATION.md


๐Ÿ“ฆ Building & Deployment

Development

npm run dev          # Start dev server (localhost:3000)

Production Build

# Standalone website (standard mode)
npm run build

# Specialized build modes
npm run build:standalone           # Complete blog site with full pages
npm run build:embeddable          # Pure HTML fragments (custom CSS)
npm run build:embeddable-bootstrap # Bootstrap-compatible fragments
npm run build:both                # Builds standalone + embeddable
npm run build:all                 # Builds all three modes

# Single file conversion (FAST)
npm run convert:md content/blog/your-post.md

Output: Static files in the out/ directory.

Tip

Single Post Conversion: Use npm run convert:md to quickly convert a single Markdown file to Bootstrap-embeddable HTML without rebuilding the entire project.

Note

Embeddable Modes:

  • build:embeddable - Clean HTML fragments for custom CSS integration
  • build:embeddable-bootstrap - Bootstrap 5-compatible fragments with included CSS

See docs/EMBEDDABLE_FRAGMENTS.md and docs/BOOTSTRAP_EMBEDDABLE.md for details.

To test the standalone build locally, you need to serve the files via an HTTP server (e.g., npx serve out). The embeddable fragments can be viewed directly as they are pure HTML snippets.

Deploy Anywhere

The blog is pure static HTML/CSS/JS. Deploy to:

  • Vercel (recommended) - Auto-deploy from GitHub
  • Netlify - Connect repo, build & publish
  • GitHub Pages - Free hosting for public repos
  • Cloudflare Pages - Fast global CDN
  • AWS S3 + CloudFront - Scalable cloud hosting
  • Any static host - Just upload the out/ folder!

Vercel Deployment (Easiest)

  1. Push your repo to GitHub
  2. Go to vercel.com
  3. Import your repository
  4. Click Deploy
  5. Done! โœจ

๐Ÿ‘‰ See docs/DEPLOYMENT.md for a detailed step-by-step guide including Environment Variables.


๐Ÿ› ๏ธ Tech Stack

  • Framework: Next.js 16 (App Router) with Static Site Generation
  • Language: TypeScript
  • Styling: Tailwind CSS v4 + Typography plugin
  • Content: Markdown/MDX with gray-matter frontmatter
  • Syntax Highlighting: highlight.js
  • Deployment: Static export (works anywhere)

๐Ÿ“š Documentation


๐ŸŽฏ Use Cases

This blog framework is perfect for:

  • ๐Ÿ’ป Developer Blogs - Technical tutorials and articles
  • ๐Ÿ“ Personal Blogs - Share your thoughts and experiences
  • ๐ŸŽจ Portfolio Sites - Showcase your work with blog posts
  • ๐Ÿ“š Documentation Sites - Product docs or knowledge bases
  • ๐Ÿข Company Blogs - Content marketing and announcements
  • ๐Ÿ“– Learning Journals - Document your learning journey
  • ๐ŸŒ Multilingual Sites - Arabic, Hebrew, or mixed LTR/RTL content
  • ๐Ÿ”ง Embeddable Content - Integrate blog posts into dashboards or CMS

๐Ÿ—บ๏ธ Roadmap

โœ… Phase 1: Core (Complete)

  • Markdown/MDX rendering
  • Blog post pages
  • Homepage with latest posts
  • Syntax highlighting
  • Dark/light mode
  • Responsive design
  • Custom theme system
  • RTL language support
  • Embeddable content mode

๐Ÿ”„ Phase 2: Enhanced Features (In Progress)

  • Search functionality
  • Tag/category filtering
  • Series support
  • Related posts
  • RSS feed
  • Sitemap generation
  • Enhanced SEO
  • UI Refinement: Integrate Shadcn UI and modern design patterns (v0/Lovable inspired)

๐Ÿ”ฎ Phase 3: Advanced (Future)

  • Comments system (Giscus)
  • Analytics integration
  • Newsletter integration
  • Social sharing
  • Performance monitoring
  • Admin Interface: Web-based CRUD for articles using react-md-editor

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  • ๐Ÿ› Found a bug? Open an issue
  • ๐Ÿ’ก Have a feature idea? Start a discussion
  • ๐Ÿ”ง Want to contribute code? Fork and submit a PR!
  • ๐Ÿ“– Improve docs? Documentation PRs are highly appreciated!

๐Ÿ“„ License

MIT License - feel free to use this for your own blog!

You are free to:

  • โœ… Use commercially
  • โœ… Modify as needed
  • โœ… Distribute
  • โœ… Use privately

Just keep the license notice. That's it!


๐Ÿ™ Acknowledgments


๐Ÿ’ฌ Support & Community

  • ๐Ÿ“– Read the docs
  • ๐Ÿ› Report issues on GitHub Issues
  • โญ Star this repo if you find it useful!

Ready to start blogging? Fork this repo and make it yours! ๐Ÿš€

Deploy with Vercel

About

A modern, production-ready blog framework built with Next.js 16. Features RTL support, embeddable mode, and static site generation.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors