Developers

Bake & export bundles

Download a website export from the Dashboard, then bake content into static HTML offline — the exit path when leaving macrocontent.

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:

NameTypeDescription
exitpresetZIP + assets + SEO — default leave-Macro package.
backuppresetExit contents plus content-types / definitions.
content-onlypresetJSON content without a full asset ZIP.
bash
# Management / dashboard session (ADMIN)
# GET /websites/:id/export?preset=exit&scope=live&locales=all&format=zip

Bundle shape

  • format: macro-site-export, version: 1
  • manifest.json — website metadata, locales
  • content/*.json — nodes with full document.i18n per locale
  • Pages store SEO per locale
  • assets/{uuid}-{filename} (or externalUrl for remote assets)

Bake CLI

bash
pnpm exec macro-bake \
  --export ./website-export.macrobundle.zip \
  --templates ./dist \
  --out ./site-static \
  --locale en \
  --strip-macro-attrs
NameTypeRequiredDescription
--exportpathrequiredPath to .macrobundle.zip or export JSON.
--templatespathrequiredDirectory of HTML templates to inject into.
--outpathrequiredOutput directory for baked HTML (+ assets).
--localestringoptionalLocale to bake; defaults to website default.
--strip-macro-attrsflagoptionalRemove data-macro-* attributes after injection.

Programmatic API

bake.mjs
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

  1. Load the export

    Reads the ZIP/JSON bundle and selects the locale (or website default).

  2. Inject into templates

    Walks HTML under --templates, injects body + SEO with the same engine as prerender (injectContentIntoHtml).

  3. Copy assets & optional strip

    Copies bundled assets into --out. With --strip-macro-attrs, removes data-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).