Operazioni sugli articoli

4 operazioni di nome article.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.

Aggiornato il
OperationWhat it doesPermissionConfirmation
article.createCreate a draft article under a blog index (blogId, the blog index page id) from its title, an optional slug and templateId, the article template it renders with.site.editnone
article.updatePatch an article as { id, patch }: its slug, title, excerpt, featured image, author, canonical URL, SEO (seo.metaTitle, metaDescription, ogImageId, noIndex), template or members-only access.site.editnone
article.publishPut an article and its current content on the public site on their own, at once, without a site publish: its status becomes published and its first publication date is set the first time.site.editpublish
article.unpublishTake an article off the public site at once: it becomes a draft again and keeps its first publication date for a later article.publish.site.editpublish

article.create

Create a draft article under a blog index (blogId, the blog index page id) from its title, an optional slug and templateId, the article template it renders with. Its content is its tree: fill it with tree.commit on the answered id; it stays off the public site until article.publish. Entry validation (page type, template, slug) and ownership checks apply.

permission: site.editwrites: pagesclass: transactionundo: yes

Esempio di input

{
  "title": "A house on the hill",
  "templateId": "article-gallery-sticky",
  "blogId": "5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c"
}

Input

FieldTypeRequiredNotes
titlestringyesAt least 1 character. At most 200 characters.
slugstringno
templateIdstringyesAt least 1 character.
localestringnoAt least 1 character. Default "en-US".
blogIdstring (uuid)yes

Output

FieldTypeRequiredNotes
idstringyes
slugstringyes
templateIdstringyes
blogIdstringno

Provala

yarn splash article.create '{"title":"A house on the hill","templateId":"article-gallery-sticky","blogId":"5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c"}' --dry-run

article.update

Patch an article as { id, patch }: its slug, title, excerpt, featured image, author, canonical URL, SEO (seo.metaTitle, metaDescription, ogImageId, noIndex), template or members-only access. Its content is its tree. Entry validation (page type, template, slug) and ownership checks apply.

permission: site.editwrites: pagesclass: transactionundo: yes

Esempio di input

{
  "id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b",
  "patch": {
    "title": {
      "en-US": "A house on the hill"
    },
    "excerpt": {
      "en-US": "Notes from the site."
    }
  }
}

Input

FieldTypeRequiredNotes
idstringyesAt least 1 character.
patchobjectyes
patch.slugstringno
patch.titlerecord of stringno
patch.excerptrecord of string | nullno
patch.featuredImageIdstring | nullno
patch.authorUserIdstring | nullno
patch.authorNamestring | nullno
patch.canonicalUrlstring | nullno
patch.seoobjectno
patch.templateIdstringnoAt least 1 character.
patch.requireAuthbooleanno
patch.requiredRolesarray of stringnoAt most 50 items.
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "patch": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "title": {
          "$ref": "#/$defs/__schema0"
        },
        "excerpt": {
          "anyOf": [
            {
              "$ref": "#/$defs/__schema0"
            },
            {
              "type": "null"
            }
          ]
        },
        "featuredImageId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "authorUserId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "authorName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "canonicalUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "seo": {
          "type": "object",
          "properties": {
            "metaTitle": {
              "anyOf": [
                {
                  "$ref": "#/$defs/__schema0"
                },
                {
                  "type": "null"
                }
              ]
            },
            "metaDescription": {
              "anyOf": [
                {
                  "$ref": "#/$defs/__schema0"
                },
                {
                  "type": "null"
                }
              ]
            },
            "ogImageId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "noIndex": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "templateId": {
          "type": "string",
          "minLength": 1
        },
        "requireAuth": {
          "type": "boolean"
        },
        "requiredRoles": {
          "maxItems": 50,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema1"
          }
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "patch"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "__schema1": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^[a-z][a-z0-9-]*$"
    }
  }
}

Output

FieldTypeRequiredNotes
idstringyesAt least 1 character.

Provala

yarn splash article.update '{"id":"4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b","patch":{"title":{"en-US":"A house on the hill"},"excerpt":{"en-US":"Notes from the site."}}}' --dry-run

article.publish

Put an article and its current content on the public site on their own, at once, without a site publish: its status becomes published and its first publication date is set the first time. Entry validation (page type, template, slug) and ownership checks apply.

permission: site.editwrites: pagesclass: transactionconfirm: publishundo: yes

Esempio di input

{
  "id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b"
}

Input

FieldTypeRequiredNotes
idstringyesAt least 1 character.

Output

FieldTypeRequiredNotes
oktrueyes

La pubblicazione non si può provare in un dry run, e la forma della CLI per una sola operazione non imposta conferme: mettila in un batch con confirmed: ["publish"] ed esegui yarn splash apply <file>.

article.unpublish

Take an article off the public site at once: it becomes a draft again and keeps its first publication date for a later article.publish. Entry validation (page type, template, slug) and ownership checks apply.

permission: site.editwrites: pagesclass: transactionconfirm: publishundo: yes

Esempio di input

{
  "id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b"
}

Input

FieldTypeRequiredNotes
idstringyesAt least 1 character.

Output

FieldTypeRequiredNotes
oktrueyes

La pubblicazione non si può provare in un dry run, e la forma della CLI per una sola operazione non imposta conferme: mettila in un batch con confirmed: ["publish"] ed esegui yarn splash apply <file>.

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

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