Site operations
4 operations named site.*. Every one runs in a batch through apply_ops, dry_run_ops, the CLI or the admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| site.read | site.read with validated settings and revisioned undo. | site.read | none |
| site.update | site.update with validated settings and revisioned undo. | site.admin | none |
| site.create | Create a new site in the program of this token's site, seeded from a blueprint (blueprintId, default blank: an empty home page with the theme's header and footer; the site's theme is the blueprint's). | site.admin | none |
| site.updateLanguages | Set the site's languages: the whole list (locales, 1 to 12 locale codes) and the default (defaultLocale, one of them). | site.admin | none |
site.read
site.read with validated settings and revisioned undo.
Example input
{}Input
The input is a record; see the schema below.
{
"type": "object",
"properties": {},
"additionalProperties": false
}Output
| Field | Type | Required | Notes |
|---|---|---|---|
| site | object | yes | |
| site.id | string | yes | |
| site.slug | string | yes | |
| site.name | string | yes | |
| site.theme | string | yes | |
| site.blueprintId | string | yes | |
| site.programId | string | no | |
| site.parentSiteId | string | null | no | |
| site.mountPath | string | null | no | |
| site.domain | string | no | |
| site.createdAt | string | yes | |
| site.updatedAt | string | yes |
Try it
yarn splash site.read '{}' --dry-runsite.update
site.update with validated settings and revisioned undo.
Example input
{
"name": "Studio site"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| name | string | no | At least 1 character. At most 255 characters. |
| slug | string | no | At least 1 character. At most 100 characters. |
| parentSiteId | string | null | no | |
| mountPath | string | null | no |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| site | object | yes | |
| site.id | string | yes | |
| site.slug | string | yes | |
| site.name | string | yes | |
| site.theme | string | yes | |
| site.blueprintId | string | yes | |
| site.programId | string | no | |
| site.parentSiteId | string | null | no | |
| site.mountPath | string | null | no | |
| site.domain | string | no | |
| site.createdAt | string | yes | |
| site.updatedAt | string | yes |
Try it
yarn splash site.update '{"name":"Studio site"}' --dry-runsite.create
Create a new site in the program of this token's site, seeded from a blueprint (blueprintId, default blank: an empty home page with the theme's header and footer; the site's theme is the blueprint's). With brand (the brand.setup input), the new site's draft design system gets that brand in the same transaction, so the site is created branded or not at all. Answers the new site; this token stays scoped to its own site, so edit the new one with a token minted for it. Run it alone in a batch with the site base revision; it is not undoable (delete the site from the admin).
Example input
{
"name": "Studio",
"slug": "studio",
"blueprintId": "blank",
"brand": {
"primary": "#1e3d4f",
"secondary": "#c8553d",
"neutral": "#737373",
"headingFamily": [
"DM Sans",
"sans-serif"
],
"bodyFamily": [
"DM Sans",
"sans-serif"
],
"typeRatio": 1.25,
"baseSize": 17,
"spaceBase": 4,
"radius": "soft"
}
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| name | string | yes | At least 1 character. At most 255 characters. |
| slug | string | yes | At least 1 character. At most 100 characters. |
| blueprintId | string | no | At least 1 character. At most 100 characters. Default "blank". |
| brand | object | no | |
| brand.primary | string | yes | |
| brand.secondary | string | yes | |
| brand.neutral | string | yes | |
| brand.headingFamily | array of string | yes | At least 1 item. |
| brand.bodyFamily | array of string | yes | At least 1 item. |
| brand.typeRatio | number | yes | One of 1.125, 1.2, 1.25, 1.333. |
| brand.baseSize | integer | yes | At least 14. At most 22. |
| brand.spaceBase | number | yes | One of 4, 8. |
| brand.radius | string | yes | One of "sharp", "soft", "round", "pill". |
| defaultLocale | string | no |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| site | object | yes | |
| site.id | string | yes | |
| site.slug | string | yes | |
| site.name | string | yes | |
| site.theme | string | yes | |
| site.blueprintId | string | yes | |
| site.programId | string | no | |
| site.parentSiteId | string | null | no | |
| site.mountPath | string | null | no | |
| site.domain | string | no | |
| site.createdAt | string | yes | |
| site.updatedAt | string | yes |
Try it
yarn splash site.create '{"name":"Studio","slug":"studio","blueprintId":"blank","brand":{"primary":"#1e3d4f","secondary":"#c8553d","neutral":"#737373","headingFamily":["DM Sans","sans-serif"],"bodyFamily":["DM Sans","sans-serif"],"typeRatio":1.25,"baseSize":17,"spaceBase":4,"radius":"soft"}}' --dry-runsite.updateLanguages
Set the site's languages: the whole list (locales, 1 to 12 locale codes) and the default (defaultLocale, one of them). An added language changes only the list: pages show the default's text in it until translated. A removed language is swept out of every draft locale map (page fields and trees, menus, collections and items, site settings, forms, media texts); a value only that language had moves to the default. Removing a language needs confirmed: ["destructive"]; the current default cannot be removed (make another language the default first). A new default first gets the old default's value wherever it has none. Published versions change at the next publish. Answers the languages and, per removed language, how many values it lost or moved. Run it with the site base revision; it is not undoable.
Example input
{
"locales": [
"it",
"fr"
],
"defaultLocale": "it"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| locales | array of string | yes | At least 1 item. At most 12 items. |
| defaultLocale | string | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| locales | array of string | yes | |
| defaultLocale | string | yes | |
| removed | array of object | yes | |
| removed[].locale | string | yes | |
| removed[].values | integer | yes | At least 0. |
Try it
yarn splash site.updateLanguages '{"locales":["it","fr"],"defaultLocale":"it"}' --dry-runGenerated from the operation registry and the MCP tool catalogue (source 3289ff41103b8dbd).
Something wrong on this page? Write to docs@librettocms.com.