Gutenberg Case Study Blocks Plan

Goal

Enable case study creators to build rich pages in WordPress Gutenberg while the Astro site renders those blocks as high-fidelity static pages.

Non-goals

Proposed architecture

  1. Authors create case studies in WordPress using a constrained block set.
  2. Build step fetches post JSON from WP REST API, including content.rendered and block metadata when available.
  3. Astro parses Gutenberg block structure into an internal AST.
  4. Supported blocks map to typed Astro components.
  5. Unsupported blocks fall back to safe HTML rendering with warning logs.
  6. Build produces static pages and a support report for editorial + dev teams.

Content model in WordPress

  1. Create a dedicated case study post type (case_study) with:
  1. Editorial constraints:

Block support matrix (phase-based)

Phase 1: core essentials

Phase 2: richer storytelling

Phase 3: advanced campaign layouts

Rendering strategy in Astro

  1. Add a block parser in the content pipeline:
  1. Create block components, e.g.:
  1. Add a block renderer switch:
  1. Sanitization and safety:

Editorial experience

  1. Add a Gutenberg “Case Study Starter” pattern with:
  1. Add docs for creators:
  1. Add preview QA checklist in editorial workflow.

Build and QA workflow

  1. During npm run build, emit:
  1. Add visual regression snapshots for top case studies.

  2. Add schema tests:

URL and routing proposal

Migration plan

  1. Pilot with 2 case studies.
  2. Freeze block set for phase 1.
  3. Build + QA + editorial review.
  4. Migrate remaining case studies in batches.
  5. Track unsupported block occurrences and prioritize next block implementations.

Risks and mitigations

  1. Risk: editorial uses unsupported blocks.
  1. Risk: design drift from authored content.
  1. Risk: embed/security issues.

Success criteria

  1. Authors can publish case studies without developer intervention.
  2. 90%+ of case study block usage supported in phase 1+2.
  3. Zero runtime dependency on WordPress rendering.
  4. Lighthouse and accessibility scores stay within current site targets.

Suggested implementation tasks

  1. Define case_study post type + taxonomies in WP.
  2. Add Gutenberg allowed-block policy for case studies.
  3. Build parser + AST types in src/lib/wp.ts pipeline.
  4. Implement phase 1 block components.
  5. Add build warnings/reporting for unsupported blocks.
  6. Pilot on 2 real case studies and iterate.

Current scaffold in this repo

The following foundation has already been added:

  1. Parser + support matrix:
  1. Renderer + JS enhancements:
  1. Core block styling layer:
  1. Sandbox route for testing block rendering: