publish_site
Publishes HTML sites as single-page content or multi-file bundles to BrewPage, returning a public URL and owner token for future updates.
Instructions
Publish an HTML site to BrewPage. Single-page: pass entryContent. Multi-page: pass files (array of {path, content}). Optional entry overrides default index.html. Use its returned primary link and retain the owner token. Limits (call get_limits for current values): a request is at most 25 MB; a site at most 200 files, 5 MB per file and 20 MB in total; each path at most 380 characters. System files (.DS_Store, __MACOSX/ and similar) are skipped and never count; files with an unsupported extension or a too-long path are skipped and listed in notices. Entry: entry, else root index.html, else the shallowest HTML file. Errors: 400 = a site limit exceeded (the message names it and what to do), invalid path or no HTML file; 413 = request over 25 MB, too many files and form fields, or a file name/path too long; 422 = no servable file left.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entry | No | Entry file path, default index.html | |
| files | No | Multi-file site: array of `{path, content}`. Mutually exclusive with `entryContent`. | |
| ttlDays | No | Requested TTL: days as a number, or a string such as '2w', '36h' or '1 month' (default 15 days). The server rounds to whole days and clamps to the allowed range (1-30 by default; owner caps differ), reporting each adjustment in notices; use returned expiresAt. | |
| password | No | Optional password to protect the site | |
| namespace | No | Optional. Omit to generate an unlisted namespace: anyone with its unpassworded link can read it, but it is excluded from gallery/search. Pass a custom namespace to group unlisted content, or pass `public` ONLY when the user explicitly wants gallery/search eligibility. Password-protected content stays excluded; unlisted, protected or otherwise ineligible native responses carry noindex; eligible public HTML, sites and files may permit indexing. | |
| ownerToken | No | Existing owner token to group this site under the same owner as previous content | |
| deliveryMode | No | Optional delivery choice for a fresh publication, independent of password/namespace. Fresh sites and HTML-format pages outside public (including the default unlisted namespace) always use subdomain; an explicit path there still publishes, on subdomain, with a delivery notice. Everything else in any namespace (Markdown, code/text, files, JSON, KV, public HTML) defaults to path (Promotion); public HTML may automatically choose subdomain for browser features. When creation returns an existing publication, it keeps its actual mode and URL. | |
| entryContent | No | HTML content for a single-page site (entry file). Mutually exclusive with `files`. |