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.

Aggiornato il
OperationWhat it doesPermissionConfirmation
site.readRead 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.readnone
site.updateRename 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.adminnone
site.createCreate 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.adminnone
site.updateLanguagesSet the site's languages: the whole list (locales, 1 to 12 locale codes) and the default (defaultLocale, one of them).site.adminnone

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.

permission: site.readreads onlyclass: read

Esempio di input

{}

Input

L’input è un record: vedi lo schema qui sotto.

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Output

FieldTypeRequiredNotes
siteobjectyes
site.idstringyes
site.slugstringyes
site.namestringyes
site.themestringyes
site.blueprintIdstringyes
site.programIdstringno
site.parentSiteIdstring | nullno
site.mountPathstring | nullno
site.domainstringno
site.createdAtstringyes
site.updatedAtstringyes

Provala

yarn splash site.read '{}' --dry-run

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). Undo restores the routing it changed.

permission: site.adminwrites: siteclass: transactionundo: yes

Esempio di input

{
  "name": "Studio site"
}

Input

FieldTypeRequiredNotes
namestringnoAt least 1 character. At most 255 characters.
slugstringnoAt least 1 character. At most 100 characters.
parentSiteIdstring | nullno
mountPathstring | nullno

Output

FieldTypeRequiredNotes
siteobjectyes
site.idstringyes
site.slugstringyes
site.namestringyes
site.themestringyes
site.blueprintIdstringyes
site.programIdstringno
site.parentSiteIdstring | nullno
site.mountPathstring | nullno
site.domainstringno
site.createdAtstringyes
site.updatedAtstringyes

Provala

yarn splash site.update '{"name":"Studio site"}' --dry-run

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). 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).

permission: site.adminwrites: siteclass: transactionundo: explicit recovery

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

FieldTypeRequiredNotes
namestringyesAt least 1 character. At most 255 characters.
slugstringyesAt least 1 character. At most 100 characters.
blueprintIdstringnoAt least 1 character. At most 100 characters. Default "blank".
brandobjectno
brand.primarystringyes
brand.secondarystringyes
brand.neutralstringyes
brand.headingFamilyarray of stringyesAt least 1 item.
brand.bodyFamilyarray of stringyesAt least 1 item.
brand.typeRationumberyesOne of 1.125, 1.2, 1.25, 1.333.
brand.baseSizeintegeryesAt least 14. At most 22.
brand.spaceBasenumberyesOne of 4, 8.
brand.radiusstringyesOne of "sharp", "soft", "round", "pill".
defaultLocalestringno

Output

FieldTypeRequiredNotes
siteobjectyes
site.idstringyes
site.slugstringyes
site.namestringyes
site.themestringyes
site.blueprintIdstringyes
site.programIdstringno
site.parentSiteIdstring | nullno
site.mountPathstring | nullno
site.domainstringno
site.createdAtstringyes
site.updatedAtstringyes

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-run

site.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.

permission: site.adminwrites: siteclass: transactionundo: explicit recovery

Esempio di input

{
  "locales": [
    "it",
    "fr"
  ],
  "defaultLocale": "it"
}

Input

FieldTypeRequiredNotes
localesarray of stringyesAt least 1 item. At most 12 items.
defaultLocalestringyes

Output

FieldTypeRequiredNotes
localesarray of stringyes
defaultLocalestringyes
removedarray of objectyes
removed[].localestringyes
removed[].valuesintegeryesAt least 0.

Provala

yarn splash site.updateLanguages '{"locales":["it","fr"],"defaultLocale":"it"}' --dry-run

Generato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 613e1e2442a9bcd7).

Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.

Guida di Libretto

Colophon. Questa guida è un sito Libretto: 70 pagine in due lingue, 21 pagine della guida importate da Markdown e 42 pagine di riferimento generate dal registro delle operazioni. Composta in Softcore, il codice in IBM Plex Mono. La sua struttura:

/it/ Guida di Libretto /it/start Per iniziare /it/start/request-access Richiedere l'accesso /it/start/workspace Il tuo spazio di lavoro /it/start/first-site Il tuo primo sito /it/start/invite-a-client Invitare un cliente /it/start/connect-claude Connettere Claude a Libretto /it/build Costruire /it/build/first-page Costruire una pagina /it/build/layers-and-canvas Livelli e canvas /it/build/site-components Componenti del sito /it/design-system Design system /it/design-system/tokens Colori, spazi e temi /it/design-system/components Componenti e varianti /it/design-system/fonts Tipografia e font /it/motion Movimento /it/motion/scenes Scene e ricette /it/motion/image-sequences Sequenze di immagini /it/motion/reduced-motion Movimento ridotto /it/publish Pubblicazione /it/publish/languages Le lingue del sito /it/publish/versions Pubblicazione e versioni /it/publish/members-and-forms Iscritti e moduli /it/publish/domains Domini /it/publish/redirects Reindirizzamenti /it/handover Consegnare un sito al cliente /it/glossary Glossario /it/agents Agenti e API /it/agents/mcp Server MCP /it/agents/cli CLI /it/agents/batches Batch /it/agents/errors Errori e segnalazioni /it/agents/operations Operazioni /it/search Cerca