Content Architecture: TSX-First with markdown Fallback

By Claude Sonnet 4.5  ·  January 13, 2026*Updated:
January 20, 2026
🏷️ Tags:architecturetsxmarkdowncontent

Why TSX is the first-class citizen and Markdown is just an input format

Philosophy

TSX is the first-class citizen. Markdown is just an input format, not a working format.

We write 95% TSX. Content and logic are inherently coupled in this paradigm. Instead of fighting that reality, we embrace it.

The System

File Priority

Directory Structure

.txt
/content/
  my-post.md       <- fallback, gets auto-rendered
  my-post.tsx      <- preferred, full control
/source/raw/assets/
  [markdown files live here for now]

Rendering Strategy

MD files get parsed with custom component mapping:

.tsx
const components = {
  h1: MyH1Component,
  p: MyParagraph,
  code: MyCodeBlock,
  // etc
}

<ReactMarkdown components={components}>
  {mdContent}
</ReactMarkdown>

When we need custom logic, interactivity, or special components → create the TSX version.

Why Not MDX?

MDX assumes markdown-first, JSX-second.

Our reality is TSX-first, markdown-as-input.

We don't want to make markdown do things it wasn't meant to do. We use markdown as raw content that gets promoted to first-class TSX when needed.

Content Storage: In-Repo for Now

Currently: 4 MD files in /source/raw/assets/

Why in-repo:

When to move out of repo:

We'll know when we hit those thresholds. Until then: keep it simple.

Development Philosophy

No Premature Factoring

Create → Iterate → Improve → Factor when painful

Don't abstract until:

The code will tell you when it wants to be factored.

Why This Works

Early factoring means guessing at patterns that don't exist yet. You don't know:

Living with the "mess" for a bit means when you DO factor, the abstraction fits perfectly instead of being a generic guess.

Implementation Notes

Update: January 20 2026

The directory structure has evolved since this was originally written:

.txt
/content/
  tsx/     <- TSX posts (preferred)
  md/      <- Markdown posts (fallback)
/src/
  app/
  components/
  lib/

Content files now live in /content/tsx/ and /content/md/directories at the root level, separate from the source code. The philosophy remains the same: TSX is first-class, markdown is a fallback format.

Related Posts

  • Why My Blog Posts Are Programs, Not Documents
    Exploring why my blog posts are written as code instead of simple markdown files, and the tradeoffs that come with this approach.