Navigation operations

5 operations named navigation.*. Every one runs in a batch through apply_ops, dry_run_ops, the CLI or the admin.

Updated
OperationWhat it doesPermissionConfirmation
navigation.readRead the draft menus of the site and their revision.site.readnone
navigation.anchorsList what an anchor target may point at: each page with the anchors of its own tree, then the header and footer anchors every page shows, marked with their region.site.readnone
navigation.upsertWrite a whole menu, replacing the menu with its key or adding it after the others.site.editnone
navigation.deleteDelete a menu; a menu prop that names it then draws nothing.site.editdestructive
navigation.reorderReorder the items of a menu: itemIds names each item once, in the new order.site.editnone

Read the draft menus of the site and their revision. A page or anchor target names its page by id. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.readreads onlyclass: read

Example input

{}

Input

The input is a record; see the schema below.

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

Output

FieldTypeRequiredNotes
navigationobjectyes
navigation.revisionintegeryesAt least 0.
navigation.menusarray of objectyes

Fields nested deeper are in the output schema that discover_operations answers with outputSchemas: true.

Try it

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

List what an anchor target may point at: each page with the anchors of its own tree, then the header and footer anchors every page shows, marked with their region. Each anchor is labelled with its first heading. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.readreads onlyclass: read

Example input

{}

Input

The input is a record; see the schema below.

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

Output

FieldTypeRequiredNotes

Try it

yarn splash navigation.anchors '{}' --dry-run

Write a whole menu, replacing the menu with its key or adding it after the others. A page or anchor target must name a page of the site; an anchor no section carries yet is a finding, not a refusal. An anchor of the header or footer (navigation.anchors marks it with its region) is shown by every page: target it as { kind: "anchor", pageId: <the home page id>, anchor: <the region anchor> }, never with the region's own page id, which is not a page of the site. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.editwrites: navigationclass: transactionundo: yes

Example input

{
  "menu": {
    "key": "main",
    "label": "Main menu",
    "items": [
      {
        "id": "item0001",
        "label": {
          "it": "Il progetto",
          "en": "The project"
        },
        "target": {
          "kind": "anchor",
          "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
          "anchor": "progetto"
        }
      },
      {
        "id": "item0002",
        "label": "Studio",
        "target": {
          "kind": "page",
          "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f"
        }
      },
      {
        "id": "item0003",
        "label": "Instagram",
        "target": {
          "kind": "external",
          "href": "https://www.instagram.com/studio"
        }
      },
      {
        "id": "item0004",
        "label": "Languages",
        "target": {
          "kind": "languages"
        }
      },
      {
        "id": "item0005",
        "label": {
          "it": "Contatti",
          "en": "Contact"
        },
        "target": {
          "kind": "anchor",
          "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
          "anchor": "contatti"
        }
      }
    ]
  }
}

Input

FieldTypeRequiredNotes
menuobjectyes
menu.keystringyesAt most 40 characters.
menu.labelstringyesAt least 1 character. At most 80 characters.
menu.itemsarray of objectyesAt most 24 items.
{
  "type": "object",
  "properties": {
    "menu": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "maxLength": 40,
          "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "items": {
          "maxItems": 24,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        }
      },
      "required": [
        "key",
        "label",
        "items"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "menu"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/__schema1"
        },
        "label": {
          "$ref": "#/$defs/__schema2"
        },
        "target": {
          "$ref": "#/$defs/__schema5"
        },
        "children": {
          "maxItems": 40,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema8"
          }
        }
      },
      "required": [
        "id",
        "label",
        "target"
      ],
      "additionalProperties": false
    },
    "__schema1": {
      "type": "string",
      "pattern": "^[0-9a-z]{8}$"
    },
    "__schema2": {
      "anyOf": [
        {
          "$ref": "#/$defs/__schema3"
        },
        {
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/__schema4"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema3"
          }
        }
      ]
    },
    "__schema3": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "__schema4": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}|\\d{3}))?$"
    },
    "__schema5": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "page"
            },
            "pageId": {
              "$ref": "#/$defs/__schema6"
            }
          },
          "required": [
            "kind",
            "pageId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "anchor"
            },
            "pageId": {
              "$ref": "#/$defs/__schema6"
            },
            "anchor": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,63}$"
            }
          },
          "required": [
            "kind",
            "pageId",
            "anchor"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "external"
            },
            "href": {
              "anyOf": [
                {
                  "$ref": "#/$defs/__schema7"
                },
                {
                  "type": "object",
                  "propertyNames": {
                    "$ref": "#/$defs/__schema4"
                  },
                  "additionalProperties": {
                    "$ref": "#/$defs/__schema7"
                  }
                }
              ]
            }
          },
          "required": [
            "kind",
            "href"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "languages"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema6": {
      "type": "string",
      "minLength": 1,
      "maxLength": 36
    },
    "__schema7": {
      "type": "string",
      "maxLength": 2048,
      "pattern": "^(?:https?:\\/\\/|mailto:|tel:|\\/(?!\\/))"
    },
    "__schema8": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/__schema1"
        },
        "label": {
          "$ref": "#/$defs/__schema2"
        },
        "target": {
          "$ref": "#/$defs/__schema5"
        },
        "group": {
          "anyOf": [
            {
              "$ref": "#/$defs/__schema9"
            },
            {
              "type": "object",
              "propertyNames": {
                "$ref": "#/$defs/__schema4"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema9"
              }
            }
          ]
        }
      },
      "required": [
        "id",
        "label",
        "target"
      ],
      "additionalProperties": false
    },
    "__schema9": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    }
  }
}

Output

FieldTypeRequiredNotes
navigationobjectyes
navigation.revisionintegeryesAt least 0.
navigation.menusarray of objectyes

Fields nested deeper are in the output schema that discover_operations answers with outputSchemas: true.

Try it

yarn splash navigation.upsert '{"menu":{"key":"main","label":"Main menu","items":[{"id":"item0001","label":{"it":"Il progetto","en":"The project"},"target":{"kind":"anchor","pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f","anchor":"progetto"}},{"id":"item0002","label":"Studio","target":{"kind":"page","pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f"}},{"id":"item0003","label":"Instagram","target":{"kind":"external","href":"https://www.instagram.com/studio"}},{"id":"item0004","label":"Languages","target":{"kind":"languages"}},{"id":"item0005","label":{"it":"Contatti","en":"Contact"},"target":{"kind":"anchor","pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f","anchor":"contatti"}}]}}' --dry-run

Delete a menu; a menu prop that names it then draws nothing. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.editwrites: navigationclass: transactionconfirm: destructiveundo: yes

Example input

{
  "key": "footer-legal"
}

Input

FieldTypeRequiredNotes
keystringyesAt most 40 characters.

Output

FieldTypeRequiredNotes
navigationobjectyes
navigation.revisionintegeryesAt least 0.
navigation.menusarray of objectyes

Fields nested deeper are in the output schema that discover_operations answers with outputSchemas: true.

Needs confirmed: ["destructive"] on the batch, which the single-operation CLI form does not set: put it in a batch file and run yarn splash apply <file> --dry-run.

Reorder the items of a menu: itemIds names each item once, in the new order. Menus are versioned with the site: publish copies them, and the public site serves the published ones.

permission: site.editwrites: navigationclass: transactionundo: yes

Example input

{
  "key": "main",
  "itemIds": [
    "item0002",
    "item0001",
    "item0003",
    "item0004",
    "item0005"
  ]
}

Input

FieldTypeRequiredNotes
keystringyesAt most 40 characters.
itemIdsarray of stringyesAt least 1 item.

Output

FieldTypeRequiredNotes
navigationobjectyes
navigation.revisionintegeryesAt least 0.
navigation.menusarray of objectyes

Fields nested deeper are in the output schema that discover_operations answers with outputSchemas: true.

Try it

yarn splash navigation.reorder '{"key":"main","itemIds":["item0002","item0001","item0003","item0004","item0005"]}' --dry-run

Generated from the operation registry and the MCP tool catalogue (source 5103a4e633cefa1c).

Something wrong on this page? Write to docs@librettocms.com.

Libretto docs

Colophon. These docs are a Libretto site: 68 pages in two languages, 20 guide pages imported from Markdown and 41 reference pages generated from the operation registry. Set in Softcore, with code in IBM Plex Mono. Its outline:

/ Libretto docs /start Get started /start/request-access Request access /start/workspace Your workspace /start/first-site Your first site /start/invite-a-client Invite a client /start/connect-claude Connect Claude to Libretto /build Build /build/first-page Build a page /build/layers-and-canvas Layers and canvas /build/site-components Site components /design-system Design system /design-system/tokens Colours, space and themes /design-system/components Components and variants /design-system/fonts Typography and fonts /motion Motion /motion/scenes Scenes and recipes /motion/image-sequences Image sequences /motion/reduced-motion Reduced motion /publish Publish /publish/languages Site languages /publish/versions Publish and versions /publish/members-and-forms Members and forms /publish/domains Domains /handover Hand a site to a client /glossary Glossary /agents Agents and API /agents/mcp MCP server /agents/cli CLI /agents/batches Batches /agents/errors Errors and findings /agents/operations Operations /search Search