A powerful static blog generator that converts Markdown files into a complete HTML website with tags, archive pages, and responsive design.
- Markdown to HTML Conversion - Write posts in simple Markdown format
- Frontmatter Support - Add metadata (title, date, tags, excerpt) to each post
- Tag System - Automatic tag pages and tag cloud
- Archive Page - Posts grouped by year
- Responsive Design - Works on mobile, tablet, and desktop
- Code Syntax Highlighting - Clean code block styling
- Sidebar with Statistics - Shows total posts and tags
- Individual Post Pages - Each post gets its own HTML page
- Local Server Support - Preview your blog instantly
- Python 3.7 or higher
- Install markdown library: pip install markdown
-
Clone the repository:
git clone https://github.com/poisonmunna/bloggenerator.git
cd blog-generator -
Install dependencies:
pip install markdown -
Create a sample post:
python blog_generator.py --sample -
Generate your blog:
python blog_generator.py -
View your blog:
cd output
python -m http.server 8000
Then open http://localhost:8000 in your browser
Create .md files in the content folder with this structure:
title: Your Post Title
date: 2024-01-15
tags: python, tutorial, blog
excerpt: A short description of your post
Your content goes here...
- List item 1
- List item 2
[code block here with triple backticks]
print("Code blocks work!")
[close triple backticks]
Save as content/my-first-post.md:
title: Learning Python
date: 2024-06-16
tags: python, programming, beginner
excerpt: A beginner's guide to Python programming
Python is a great language for beginners!
- Easy to learn
- Versatile
- Large community
[code block with triple backticks]
name = "John"
print(f"Hello, {name}!")
[close triple backticks]
| Page | Description |
|---|---|
| index.html | Homepage showing all posts with excerpts |
| archive.html | All posts grouped by year |
| tags.html | Index page showing all tags |
| tags/[tag].html | Posts filtered by specific tag |
| posts/[post].html | Individual post pages |
| Command | Description |
|---|---|
| python blog_generator.py | Generate the blog |
| python blog_generator.py --sample | Create a sample post |
| python blog_generator.py --help | Show help |
blog-generator/
│
├── blog_generator.py # Main script
├── content/ # Put your .md files here
│ ├── welcome.md
│ ├── post1.md
│ └── post2.md
├── output/ # Generated HTML
│ ├── index.html
│ ├── archive.html
│ ├── tags.html
│ ├── posts/
│ │ ├── welcome.html
│ │ ├── post1.html
│ │ └── post2.html
│ └── tags/
│ ├── Python.html
│ └── Tutorial.html
└── README.md
==================================================
📝 BLOG GENERATOR
==================================================
📂 Loading posts...
✅ Loaded 3 posts
✅ Found 5 tags
✅ Generated: index.html
✅ Generated: posts/welcome.html
✅ Generated: posts/python-tips.html
✅ Generated: tags/Python.html
✅ Generated: tags/Tutorial.html
✅ Generated: tags.html
✅ Generated: archive.html
==================================================
🎉 BLOG GENERATED SUCCESSFULLY!
==================================================
📁 Output: C:\blog-generator\output
🌐 To view your blog:
cd output
python -m http.server 8000
Then open http://localhost:8000
==================================================
cd output
git init
git add .
git commit -m "Initial blog"
git remote add origin https://github.com/username/username.github.io.git
git push -u origin main
Then visit: https://username.github.io
- Go to netlify.com
- Drag and drop your output folder
- Your blog is live instantly
- Install Vercel CLI: npm install -g vercel
- cd output
- vercel --prod
Solution: pip install markdown
Solution: Run python blog_generator.py --sample first
Solution: python -m http.server 8080
Solution: Make sure .md files are in content folder
- Gradient Header - Purple to blue gradient background
- Card Layout - Each post appears in a card with shadow
- Hover Effects - Cards lift on hover
- Tag Buttons - Colorful, clickable tags
- Responsive Grid - Adapts to screen size
- Code Blocks - Styled with background and monospace font
- Generation Speed: ~0.1 seconds per post
- Memory Usage: ~50 MB for 1000 posts
- Output Size: ~10 KB per post
Contributions are welcome!
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
Distributed under the MIT License. See LICENSE file for more information.
Your Name - 123razz321@gmail.com
Project Link: https://github.com/poisonmunna/bloggenerator
If this project helped you create your blog, please give it a star on GitHub!
Made with Python | Write in Markdown, Publish in HTML! 📝


