Skill: Read Site
Return the source of one of your organization's sites as of its newest draft, with its pages and a list of its images and fonts. Writes nothing.
Read Site returns the current source of a site your organization owns, so the Web Builder can change it without losing what’s there. It comes with the Web Builder, which calls it before every Update Site.
It reads the newest draft, which is what the next change builds on. That can be ahead of what visitors see. It writes nothing.
Parameters
| Parameter | Type | Description |
|---|---|---|
site_name | string | The site, as List Sites reports its site_name. Required |
Response
| Field | Description |
|---|---|
success | true |
mode | fetch |
site_name, username | The site and its organization’s slug |
html | The newest draft’s index.html |
css | Its styles.css, or empty when it has none |
js | Its script.js, or empty when it has none |
pages | Each extra page as { filename, html } |
assets | Each image and font as { filename, size, content_type }. The file contents aren’t returned |
The response is the same as Update Site’s with fetch_current: true.
When it refuses
A site_name the organization doesn’t have, including another organization’s site, is reported as “not found or you do not have permission to read it”.
Related skills: Update Site | Edit Site | Retrieve Site