Skip to content

March 20, 2026

Modular Writing Templates

Keep article content independent from presentation by moving layout concerns into shared components.

1 min read

When each post owns its layout, redesigns become migration projects. When layout is centralized, redesigns become component updates.

Template boundaries

Keep these concerns in the template layer:

  • spacing
  • typography rhythm
  • TOC behavior
  • callout styles
  • code block styling

Keep this in the post file:

  • ideas
  • headings
  • media
  • code examples

Example

export function PostTemplate({ post, children }: Props) {
  return <article className="mx-auto max-w-6xl">{children}</article>;
}

Practical result

A single update to PostTemplate can refresh every historical article without touching content files.