ShawDocs
Template Library

Publishing templates to R2

Publish self-contained HTML, CSS, and JS bundles to Shaw's R2 store via Web, API, CLI, or GitHub Actions with an edge-locked source runtime.

All template publishes write through Shaw's single validated R2 engine (shaw-templates), enforcing self-contained assets, .woff2 fonts, 640×400 thumbnails, immutable _versions/<slug>/<version>/ snapshots, and additive etagMatches manifest merges—without waiting on application CI.

Three ways to publish

Publish Studio UI (/templates/publish)

Open shaw.ai/templates/publish, drop a static clone folder or bundle archive, inspect the auto-parsed brand and surface metadata plus the 16:10 preview, run a zero-write Validate (Dry Run), and choose Publish to R2.

Direct HTTP API & CLI

Run Shaw's CLI publisher directly from your repository or CI environment, or POST to https://shaw.ai/api/templates/publish/ authenticated with a SHAW_PUBLISH_TOKEN, a Shaw API key (pages:write), or a signed-in operator session.

GitHub Actions (publish-template.yml)

Trigger workflow_dispatch with slug and bundle_path (or push a submit/* / replace/* branch) to validate and publish directly to R2.

CLI & HTTP API examples

Validate a local bundle first without mutating R2, then publish:

bun scripts/publish-template.mjs ./bundle --slug acme/landing --dry-run
bun scripts/publish-template.mjs ./bundle --slug acme/landing

To replace an existing surface revision explicitly, pass --replace:

bun scripts/publish-template.mjs ./bundle --slug acme/landing --replace

Shaw writes each asset to R2 under its content type, merges the catalog manifest, and returns the permanent https://shaw.ai/templates/<templateId> viewer URL.

Edge-locked source policy

Template source archives stay locked to Shaw—external archive reads under /api/templates/zip/* always return HTTP 403. Remixed sites and pages are built and hosted directly on Shaw (*.shaw.site or custom domains) or published to Shopify Pages and Klaviyo. See Authentication & API keys for creating pages:write keys, Remix & Shaw hosting to deploy Brand Kit remixes, or browse 19 categories and Shaw Learn.

On this page