maud-axum-integration

Integrate Maud HTML templates with Axum endpoints for server-side rendered responses.

3|Updated Nov 16, 2025
One-click install
npx skills add https://github.com/matthewharwood/engmanager.xyz --skill maud-axum-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maud-axum-integration
Source: https://github.com/matthewharwood/engmanager.xyz/tree/main/.claude/skills/maud-axum-integration
Command: npx skills add https://github.com/matthewharwood/engmanager.xyz --skill maud-axum-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides patterns for server-side rendering with Maud templates in Axum apps, including IntoResponse, templating state, and layout composition for SSR UI.

Core Features & Use Cases

  • Maud integration with Axum IntoResponse
  • State management with Maud templates
  • Layouts and error pages for SSR apps
  • Server-side rendering architecture (MASH/HARM stack)

Quick Start

Set up Axum routes returning Maud Markup, wire shared AppState, and render layouts with Maud templates.

Frequently Asked Questions about maud-axum-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I render HTML with Maud templates in an Axum web application?

Maud templates render HTML server-side in Axum by implementing IntoResponse for Maud Markup types, allowing routes to return compiled templates as HTTP responses. Wire your Axum handlers to accept AppState, pass data to Maud templates, and return the markup directly—Axum serializes it as HTML.

Can I use Maud for server-side rendering with Axum?

Yes. Maud integrates with Axum through IntoResponse implementations and the maud crate's axum feature flag. Enable it in Cargo.toml, then return Markup types from route handlers to produce server-side rendered HTML responses with full template composition support.

How do I structure layouts and error pages with Maud in Axum?

Build reusable layouts by composing Maud templates that accept state and child content, then nest them within error handlers and route templates. Pass shared AppState through the composition chain so layouts access application context for rendering consistent page structure and error displays.

What are the prerequisites for integrating Maud templates with Axum?

Maud integration requires Rust 2021 edition, Axum 0.8.x, the maud crate with the axum feature enabled, a Tokio runtime, and routes that implement IntoResponse. Ensure your Cargo.toml includes both crates and the feature flag for seamless template-to-response conversion.

How do I manage template state and pass application context to Maud templates?

Define an AppState struct, extract it in Axum handlers using State extractor, and pass fields directly to Maud template closures. Templates receive the state data and render it into markup, enabling stateful rendering across layouts, pages, and error responses.

Does server-side rendering with Maud and Axum work for HTMX interactions?

Yes. Maud templates render HTML fragments that HTMX requests consume, and Axum routes return Markup responses with appropriate Content-Type headers. This pattern supports dynamic partial updates, form submissions, and interactive SSR workflows in MASH/HARM stack architectures.