Technical Articles & Tutorials

Why We're Restructuring This Blog: From HTML Templates to Content Blocks

If you're reading this article, you're seeing the result of a significant architectural change to how this blog works. What looks the same on the surface represents a fundamental shift from hardcoded HTML templates to a flexible block-based content system.

The Problem We Had

Like many developers, I built this blog the "quick" way: individual HTML templates for each article, with content mixed directly into presentation markup. It worked fine for a handful of posts, but as the site grew to 60+ articles, the problems became clear:

  • Repetitive code: The same card structures, headers, and layouts copied across dozens of files
  • Design lock-in: Changing the appearance of content blocks required editing every single article
  • Content trapped in markup: Article content was inseparable from Bootstrap classes and HTML structure
  • Maintenance burden: Simple styling changes became multi-file editing sessions

The HTML Identity Crisis

HTML was originally designed to be semantic—to describe the meaning of content, not its appearance. A heading was <h1> because it was semantically a heading, not because of how it looked.

But somewhere along the way, HTML became a presentation language. Instead of semantic markup, we ended up with <div class="card mb-4 shadow-lg border-0"> where the CSS classes do all the real work of describing what something is.

What We Lost

When HTML became presentational, we lost the ability to separate content from presentation. Our articles weren't just "text with some key takeaway boxes"—they were "div elements with Bootstrap card classes containing unordered lists with specific CSS styling."

Why Not Markdown?

Markdown solved the "too much HTML complexity" problem beautifully. It gave us clean, readable content that could be written by humans and understood by machines. But Markdown has limitations for rich content:

  • No standard way to represent complex structures like comparison tables
  • Limited semantic block types beyond basic formatting
  • Extension syntax varies wildly between platforms
  • Difficult to add styling hints or layout information

Markdown was perfect for simple documents, but modern web content needs more structure.

Enter Content Blocks

Instead of fighting with HTML or extending Markdown, we decided to treat content as structured data. Each article is now composed of semantic blocks that describe what the content is, not how it should look:

Example: This Very Card

This highlighted box is defined as:

  • "type": "card" - semantically, it's a highlighted content block
  • "header": "Example: This Very Card" - the title of the block
  • "content": "This highlighted box..." - the main text content
  • "list": [...] - bullet points within the block

The actual styling—Bootstrap classes, colors, spacing—gets applied when the block is rendered, not stored with the content.

The Benefits Are Immediate

Even with just one article converted to this system, the advantages are clear:

  • Design consistency: All card blocks use the same template, so they always look identical
  • Easy updates: Changing how cards look requires editing one template file, not dozens of articles
  • Content portability: The same content could render as HTML, mobile app screens, or even voice assistant responses
  • Reusable components: Complex structures like comparison tables become reusable block types

Technical Implementation

The technical approach is straightforward. Articles are stored as JSON files with a simple structure:

JSON Block Structure

Each block has a type (paragraph, heading, card, list) and data specific to that type. A paragraph block contains text content, while a card block contains header, content, and optional list items.

When someone requests an article, the system loads the JSON, loops through the blocks, and renders each one using its corresponding template. The routing system tries JSON articles first, then falls back to the old HTML templates for backward compatibility.

Why This Matters

This isn't just a technical exercise. It's about creating content that outlasts any particular technology choice. Whether this site runs on Flask, Django, React, or something that hasn't been invented yet, the content remains portable and reusable.

More importantly, it restores the separation between content and presentation that we lost when HTML became a styling language. Content describes meaning; templates handle appearance.

The Bottom Line

We've essentially created what HTML should have remained: a semantic content format that preserves meaning while enabling rich presentation through a clean separation layer.

It's funny how technology evolves. We started with semantic HTML, moved to presentational HTML mixed with CSS frameworks, and now we're back to structured content—but this time we're keeping the layers properly separated.

About

Why fear those copying you, if you are doing good they will do the same to the world.

Archives

  1. AI & Automation
  2. AI Filtering for Web Content
  3. Web Fundamentals & Infrastructure
  4. Reclaiming Connection: Decentralized Social Networks
  5. Web Economics & Discovery
  6. The Broken Discovery Machine
  7. Evolution of Web Links
  8. Code & Frameworks
  9. Breaking the Tech Debt Avoidance Loop
  10. Evolution of Scaling & High Availability
  11. Evolution of Configuration & Environment
  12. Evolution of API Support
  13. Evolution of Browser & Client Support
  14. Evolution of Deployment & DevOps
  15. Evolution of Real-time Capabilities
  16. The Visual Basic Gap in Web Development
  17. Evolution of Testing & Monitoring
  18. Evolution of Internationalization & Localization
  19. Evolution of Form Processing
  20. Evolution of Security
  21. Evolution of Caching
  22. Evolution of Data Management
  23. Evolution of Response Generation
  24. Evolution of Request Routing & Handling
  25. Evolution of Session & State Management
  26. Web Framework Responsibilities
  27. Evolution of Internet Clients
  28. Evolution of Web Deployment
  29. The Missing Architectural Layer in Web Development
  30. Development Velocity Gap: WordPress vs. Modern Frameworks
  31. Data & Storage
  32. Evolution of Web Data Storage
  33. Information Management
  34. Manual Bookkeeping with a Columnar Pad
  35. Managing Tasks Effectively: A Complete System
  36. Managing Appointments: Designing a Calendar System
  37. Building a Personal Knowledge Base
  38. Contact Management in the Digital Age
  39. Project Management for Individuals
  40. The Art of Response: Communicating with Purpose
  41. Strategic Deferral: Purposeful Postponement
  42. The Art of Delegation: Amplifying Impact
  43. Taking Action: Guide to Decisive Execution
  44. The Art of Deletion: Digital Decluttering
  45. Digital Filing: A Clutter-Free Life
  46. Managing Incoming Information
  47. Cloud & Infrastructure
  48. Moving from Cloud to Self-Hosted Infrastructure
  49. AWS Lightsail versus EC2
  50. WordPress on AWS Lightsail
  51. Migrating from Heroku to Dokku
  52. Storage & Media
  53. Vultr Object Storage on Django Wagtail
  54. Live Video Streaming with Nginx
  55. YI 4k Live Streaming
  56. Tools & Connectivity
  57. Multi Connection VPN
  58. Email Forms with AWS Lambda
  59. Static Sites with Hexo

Optimize Your Website!

Is your WordPress site running slowly? I offer a comprehensive service that includes needs assessments and performance optimizations. Get your site running at its best!

Check Out My Fiverr Gig!

Elsewhere

  1. YouTube
  2. Twitter
  3. GitHub