As a retired U.S. Army Staff Sergeant turned tech enthusiast, I write across multiple platformsโWordPress, Dev.to, Hashnode, Daily.dev, and Ko-fi. But managing separate audiences was messy. I wanted one central hub where readers could find all my content.
So, I built a static blog aggregator using only HTML, CSS, and vanilla JavaScriptโno frameworks, no backend, just clean code. Hereโs how I did it.
๐ Why I Built This
Problem: My posts were scattered across platforms, making it hard for readers to follow everything.
Goal: A single page that pulls all my content into a searchable, filterable grid.
Constraints:
- No reliance on unstable APIs
- Easy to update manually
- Fast, responsive, and accessible
๐ ๏ธ Tech Stack
- Frontend: Pure HTML, CSS, JavaScript
- Data Management: Manual JSON files (no database)
- Hosting: GitHub Pages (free & serverless)
๐ง How It Works
1. JSON-Powered Content Management
Instead of APIs, I store posts in platform-specific JSON files:
// data/devto.json
[
{
"title": "My Dev.to Post",
"excerpt": "How I built this aggregator...",
"date": "2023-12-01T00:00:00", // UTC format avoids timezone issues
"image": "https://example.com/cover.jpg",
"url": "https://dev.to/username/post",
"source": "devto"
}
]
โ Pros
- Full control over displayed content
- No API rate limits or downtime
- Easy to edit (just update JSON)
2. Dynamic Post Loading with JavaScript
The site fetches and renders posts from all JSON files:
async function loadAllPosts() {
const platforms = ['devto', 'wordpress', 'hashnode'];
const allPosts = [];
for (const platform of platforms) {
const response = await fetch(`data/${platform}.json`);
const posts = await response.json();
posts.forEach(post => allPosts.push({ ...post, source: platform }));
}
// Sort by date (newest first)
allPosts.sort((a, b) => new Date(b.date) - new Date(a.date));
displayPosts(allPosts);
}
3. Filtering & Search
- Platform filters (WordPress, Dev.to, etc.)
- Real-time search (matches titles/excerpts)
function filterPosts(platform) {
document.querySelectorAll('.post-card').forEach(card => {
card.style.display =
(platform === 'all' || card.classList.contains(platform))
? 'block' : 'none';
});
}
4. Futuristic UI Touches
-
Hexagonal profile image (CSS
clip-path
) - Particle.js background (for a sci-fi vibe)
- Dark theme with accent colors
.hexagon {
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
๐ก Key Challenges & Solutions
โ Problem: Timezone Mismatches
-
Cause:
new Date("2023-12-01")
converts to UTC, which can shift dates backward in some timezones. -
Fix: Added
T00:00:00
to JSON dates ("2023-12-01T00:00:00"
) to lock them to UTC.
โ Problem: No API for Some Platforms
- Solution: Manual JSON updatesโit's a trade-off for reliability, but ensures full control.
โ Problem: Mobile Responsiveness
- Solution: Used CSS Grid + Flexbox with responsive media queries to handle layouts across devices.
๐ Results
- โ Readers can now browse all my content in one place
- โ No backend costs (hosted on GitHub Pages)
- โ Easy to updateโjust edit JSON files
๐ Future Improvements
- Add RSS auto-import (for less manual updates)
- Dark/light mode toggle
- Weekly automated backups
๐ฌ Your Thoughts?
Would you use a system like this?
How do you manage cross-platform content?
Letโs discuss in the comments!
๐ View Live | GitHub Repo
P.S. If you found this useful, consider supporting me on Ko-fi to keep projects like this coming!
Top comments (0)