Frontmatter Solo — Twig
Astro to Twig.
One command.
Solo reads your constrained Astro component Props interfaces and generates a complete Twig render pack — partials, layouts, pages, variable manifest, and integration doc.
Twig output · Symfony · Drupal · Craft · $49 one-time
Solo generates templates and a variable contract from your Astro project. Backend integration (data fetching, routing, CMS wiring) remains your responsibility.
Props become fm.props variables.
Optional props become {% if %} blocks.
Slots become {% block %} regions.
The mapping is mechanical.
Solo automates it.
---
export interface Props {
headline: string; // required — literal only
sub?: string; // optional
ctaLabel?: string; // optional
ctaHref?: string; // optional
}
const { headline, sub, ctaLabel, ctaHref } = Astro.props;
---
<section class="hero">
<h1>{headline}</h1>
{sub && <p>{sub}</p>}
{ctaLabel && <a href={ctaHref}>{ctaLabel}</a>}
</section> {# partials/hero.html.twig — generated by FM Solo #}
<section class="hero">
<h1>{{ fm.props.headline }}</h1>
{% if fm.props.sub %}
<p>{{ fm.props.sub }}</p>
{% endif %}
{% if fm.props.ctaLabel %}
<a href="{{ fm.props.ctaHref }}">
{{ fm.props.ctaLabel }}
</a>
{% endif %}
</section> Mapping rules
Consistent, predictable output
Required prop → {{ fm.props.x }}. Optional prop → {% if %}. Slot → {% block %}. Every time, without exception.
Fixed data contract
fm.props everywhere
Partials always receive fm.props. Pages and layouts read fm.site, fm.page, fm.data. Your backend populates these namespaces.
Frameworks
Works wherever Twig runs
Symfony, Drupal, Craft CMS, Statamic, standalone Twig. Generic Twig conventions — no framework-specific assumptions in the output.
PHP too
Switch adapter anytime
Same Astro source. --adapter twig for Symfony and Drupal. --adapter php for WordPress and vanilla PHP. One flag.
The mapping is not magic.
Solo reads your Props interface. It maps each typed literal prop to a Twig variable under fm.props. It preserves your HTML structure exactly. The output is readable, editable, and exactly what a Twig developer would write by hand.
Solo requires a constrained Astro project. Run npx @withfrontmatter/solo-check first if you're not starting from the public starter.
Frequently asked questions
What Twig features does Solo generate?
Solo generates {{ fm.props.x }} for required props, {% if fm.props.x %} for optional props, {% for item in fm.props.items %} for arrays, {% block content %} for Astro slots, and {% extends %} / {% include %} for layout and partial structure.
What is the fm.props namespace?
Solo uses a fixed data contract. Partials read fm.props. Pages and layouts read fm.site, fm.page, and fm.data. Your backend populates these namespaces. INTEGRATION.md documents what each template expects.
What prop types are supported?
Solo v1 supports literal props only: string, number, boolean, and null. Dynamic expressions like headline={page.title} fail validation with error E201. This constraint is what makes the output predictable.
Does Solo handle Astro slots?
Yes. Astro <slot /> elements become {% block content %}{% endblock %} in generated layouts, using standard Twig template inheritance.
Can I use the output with Drupal, Craft CMS, or Statamic?
Yes. The output follows generic Twig conventions. You may need to adapt include paths and map the fm.props structure to your CMS's template data model.
Free · Open source
Check compatibility before you buy.
solo-check is a free CLI validator. It scans your Astro project against the Solo contract and tells you exactly what is and isn't compatible before you purchase anything. Use --help-ai if you want the packaged AI workflow.
npx @withfrontmatter/solo-check
✓ Command copied
Example output
✓ src/pages/index.astro — OK
✓ src/layouts/Base.astro — OK
E201 src/pages/contact.astro:13 Non-literal props used in component Hero.
Fix: Use only string, number, boolean, or null props in Solo v1.
──────────────────────────────────────────
1 error · 0 warnings
Tip: use the AI workflow to fix these errors automatically.
npx @withfrontmatter/solo-check --help-ai
────────────────────────────────────────── Exit 0 means your project is ready for Solo. Use npx @withfrontmatter/solo-check --help-ai if you want the packaged AI fixing workflow. View on GitHub ↗
$49
One-time purchase. No subscription.
- CLI — macOS, Linux, Windows (Node)
- Desktop app — macOS 12+ · Apple Silicon
- Twig output — all frameworks
- Plain PHP output included
- Starter reference project included
- INTEGRATION.md auto-generated
Provided as-is. Requires a Solo-compatible Astro project. No guarantee of compatibility with all Astro configurations. Support is best-effort.