Two steps
Export produces a
.macrobundle.zip (or JSON) with content, SEO, and assets. Bake merges that bundle into your HTML templates without calling the API. Export from the Dashboard
Owners and admins open Export & exit and choose a preset:
| Name | Type | Description |
|---|---|---|
exit | preset | ZIP + assets + SEO — default leave-Macro package. |
backup | preset | Exit contents plus content-types / definitions. |
content-only | preset | JSON content without a full asset ZIP. |
# Management / dashboard session (ADMIN)
# GET /websites/:id/export?preset=exit&scope=live&locales=all&format=zipBundle shape
format: macro-site-export,version: 1manifest.json— website metadata, localescontent/*.json— nodes with fulldocument.i18nper locale- Pages store SEO per locale
assets/{uuid}-{filename}(orexternalUrlfor remote assets)
Bake CLI
pnpm exec macro-bake \
--export ./website-export.macrobundle.zip \
--templates ./dist \
--out ./site-static \
--locale en \
--strip-macro-attrs| Name | Type | Required | Description |
|---|---|---|---|
--export | path | required | Path to .macrobundle.zip or export JSON. |
--templates | path | required | Directory of HTML templates to inject into. |
--out | path | required | Output directory for baked HTML (+ assets). |
--locale | string | optional | Locale to bake; defaults to website default. |
--strip-macro-attrs | flag | optional | Remove data-macro-* attributes after injection. |
Programmatic API
import { bakeDirectory } from '@macrocontent/sdk/node'
await bakeDirectory({
exportPath: './website-export.macrobundle.zip',
templatesDir: './dist',
outDir: './site-static',
locale: 'en',
stripMacroAttrs: true,
copyAssets: true,
stampSsr: true,
}) Imports live under @macrocontent/sdk/node and @macrocontent/sdk/export (loadMacroExport, exportToLiveValueRows, bakeDirectory).
What bake does
Load the export
Reads the ZIP/JSON bundle and selects the locale (or website default).
Inject into templates
Walks HTML under
--templates, injects body + SEO with the same engine as prerender (injectContentIntoHtml).Copy assets & optional strip
Copies bundled assets into
--out. With--strip-macro-attrs, removesdata-macro-*and Macro SDK scripts for a clean static site.
Do
- Bake from the same HTML templates you used while on Macro.
- Keep a backup export even if you stay on Macro.
Don’t
- Don’t expect bake to call the live API — it is fully offline.
- Don’t confuse bake with prerender (prerender needs a secret + live API).