A production-ready static blog template for GitHub Pages. Built with vanilla JavaScriptβno frameworks, no build tools, no dependencies except CDN libraries.
π View Demo | π Documentation | π Report Bug
- Zero Build Step β Push to GitHub, instantly deployed
- Full-Text Search β Fast search with tag/topic filtering
- Dark Mode β Auto-detection with manual toggle
- Fully Responsive β Optimized for 320px to 2560px
- Accessible β WCAG 2.2 Level AA compliant
- Offline Ready β Works without internet connection
- SEO Optimized β Meta tags, OpenGraph, Schema.org markup
- Fork this repository
- Edit
config.jsonwith your site details - Add posts to
posts/directory (Markdown format) - Push to GitHub β Automatic deployment to GitHub Pages
Your blog is live at https://yourusername.github.io
Create Markdown files in the posts/ directory:
---
title: Your Post Title
date: 2025-01-15
author: Your Name
tags: [javascript, tutorial, web-development]
topic: Web Development
excerpt: A brief description of your post
image: /assets/images/post-image.jpg
---
Your content here using Markdown...| Field | Required | Description |
|---|---|---|
title |
Yes | Post title |
date |
Yes | Publication date (YYYY-MM-DD) |
author |
No | Author name (defaults to site author) |
tags |
No | Array of tags |
topic |
No | Post category/topic |
excerpt |
No | Short description |
image |
No | Featured image URL |
All site settings are in config.json:
{
"site": {
"title": "My Blog",
"tagline": "Thoughts on code and technology",
"author": "Your Name",
"url": "https://yourblog.com",
"description": "Blog description for SEO"
},
"theme": {
"mode": "auto",
"colors": {
"primary": "#007AFF",
"success": "#34C759",
"warning": "#FF9F0A"
}
},
"features": {
"search": true,
"tags": true,
"darkMode": true,
"readingTime": true,
"relatedPosts": true
}
}titleβ Your blog nametaglineβ Subtitle/descriptionauthorβ Default author nameurlβ Your blog URL (for SEO)descriptionβ Meta description
modeβ "light", "dark", or "auto"colorsβ Customize primary colors
Toggle features on/off:
searchβ Enable search functionalitytagsβ Show post tagsdarkModeβ Dark mode togglereadingTimeβ Calculate reading timerelatedPostsβ Show related posts
βββ index.html # Homepage
βββ post.html # Post template
βββ archive.html # Archive page
βββ 404.html # Error page
βββ config.json # Site configuration
βββ app.js # Main JavaScript
βββ style.css # Styles
βββ posts/ # Your blog posts
β βββ *.md
βββ assets/
β βββ images/ # Images
βββ docs/ # Documentation
Edit config.json to change theme colors:
{
"theme": {
"colors": {
"primary": "#007AFF",
"primaryHover": "#0051D5"
}
}
}Colors use CSS variables. Override in your styles:
:root {
--color-primary: #007AFF;
--color-text: #1D1D1F;
}CSS variables control typography:
:root {
--font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
--font-size-base: 16px;
--line-height-base: 1.6;
}Adjust layout widths:
:root {
--content-width: 1200px;
--reading-width: 680px;
}Search supports:
- Full-text search across all posts
- Tag filtering:
#javascript - Topic filtering:
@tutorial
Combine filters: #react @tutorial advanced hooks
Dark mode:
- Auto-detects system preference
- Manual toggle in navigation
- Persists user preference
- Smooth transitions
This template follows WCAG 2.2 Level AA guidelines:
- Semantic HTML structure
- ARIA labels on interactive elements
- Keyboard navigation support
- 44px minimum touch targets
- Color contrast ratios β₯4.5:1
- Screen reader tested
| Browser | Version | Support |
|---|---|---|
| Chrome | 90+ | Full |
| Firefox | 88+ | Full |
| Safari | 14+ | Full |
| Edge | 90+ | Full |
| IE 11 | β | Basic (no JS features) |
- Lighthouse score: 95+
- First Contentful Paint: <1s
- Time to Interactive: <2s
- Search latency: <100ms
- Enable GitHub Pages in repository settings
- Set source to
mainbranch - Push changes
- Site updates automatically
- Add
CNAMEfile with your domain - Configure DNS records with your provider
- Enable HTTPS in GitHub Pages settings
# Python 3
python3 -m http.server 8000
# Node.js
npx http-server
# PHP
php -S localhost:8000Visit http://localhost:8000
- No hardcoded values (use
config.json) - Comments explain why, not what
- Semantic naming conventions
- JSDoc for all functions
MIT License - free to use, modify, and distribute.
Built with:
Contributions welcome! Please read CONTRIBUTING.md for guidelines.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
View Demo β’ Report Bug β’ Request Feature