Publish files you wrote
publish_filesPublishes one or more files written here — markdown, HTML, CSS, JSON — as a site, and returns its URL. A single page goes at index.html; a single .md, .markdown or .pdf file is a site on its own, served through the documents viewer.
Instructions
Publishes one or more files written here — markdown, HTML, CSS, JSON — as a site, and returns its URL. A single page goes at index.html; a single .md, .markdown or .pdf file is a site on its own, served through the documents viewer. Text only: a PDF or an image has to be published from disk with publish_dir.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Subdomain or site id to publish over. Omit to create a new site. | |
| files | Yes | The files to publish. | |
| folder | No | Folder to file the new site in, when the person asked for one: its path of names such as Clients/Acme, or its id from list_folders. Only for a new site — do not pass it together with `site`; moving an existing site is update_site's `folder`. It never creates a folder: a folder that does not exist is refused with the list of those that do, and nothing is published. | |
| subdomain | No | Subdomain to create the new site under, when the person asked for a particular address. Only for a new site: leave it out to publish over an existing one, and do not pass it together with `site`. Ask rather than inventing one — the name is the URL somebody will be given, it cannot be changed afterwards, and an unused site made under a guessed name has to be deleted by hand. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The live URL of the published site. | |
| files | Yes | How many files the site now serves. | |
| siteId | Yes | Identifier of the site, stable across publishes. | |
| subdomain | Yes | The site's subdomain, which is what `site` accepts. | |
| unchanged | Yes | True when every file already matched what the site served, so no new version was published. |