Operazioni sul sito
4 operazioni di nome site.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| site.read | Read the site record: its id, slug (the site part of its platform address, <site>--<program>.<base domain>), name, theme, blueprint, program, and the parent site and mount path when it is mounted under another site. | site.read | none |
| site.update | Rename the site, change its slug (lowercase letters, digits and single hyphens; a reserved slug is refused, one another site holds is 409 site_slug_exists) or mount it under another site of the same workspace at a path (parentSiteId, mountPath; null unmounts it). | 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
Read the site record: its id, slug (the site part of its platform address, <site>--<program>.<base domain>), name, theme, blueprint, program, and the parent site and mount path when it is mounted under another site. site_context answers its languages and addresses.
Esempio di input
{}Input
L’input è un record: vedi lo schema qui sotto.
{
"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 |
Provala
yarn splash site.read '{}' --dry-runsite.update
Rename the site, change its slug (lowercase letters, digits and single hyphens; a reserved slug is refused, one another site holds is 409 site_slug_exists) or mount it under another site of the same workspace at a path (parentSiteId, mountPath; null unmounts it). Undo restores the routing it changed.
Esempio di 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 |
Provala
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).
Esempio di 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 |
Provala
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.
Esempio di 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. |
Provala
yarn splash site.updateLanguages '{"locales":["it","fr"],"defaultLocale":"it"}' --dry-runGenerato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 613e1e2442a9bcd7).
Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.