Static Export Blog Content System

Next.js 15 · MDX · Static Export

Building a Static Export Content Pipeline

A sample article that exercises validated metadata, safe MDX components, and generated table of contents data.

Building a Static Export Content Pipeline hero image

핵심 요약

Korean headings use the same generated ID in the article table of contents and the rendered MDX heading.

Content Source of Truth

The blog keeps post metadata and body content together under content/posts. Build-time utilities read each MDX file, validate the front matter, and expose typed metadata to route code.

Published Filtering

Published posts are the only posts returned by the default loader. Draft and archived states stay available to validation code but are excluded from public lookup helpers.

MDX Safety Rules

Authoring stays constrained to registered components. The validation script rejects raw scripts, arbitrary imports, dangerous HTML escape hatches, private URLs, and token-like content before a production build can continue.

const publicationStatus = "published";

function canRenderPost(status: string) {
  return status === publicationStatus;
}

SEO preview

Title
Static Export Blog Content System
Description
A validated MDX article with registered component output.
Keywords
MDX, Static Export, Structured Content
Standalone MDX captions render through the registered component map.

Table of Contents

Only second- and third-level headings become table of contents entries. Deeper headings remain part of the article body without adding noise to the navigation surface.

Ignored Deep Heading

This heading is intentionally deeper than H3 so the table of contents extractor can prove it is ignored.

  • Front matter validates
  • Published loader can find this post
  • H4 headings stay out of the TOC
TOP