Markdown image sizes

Offer named image widths in the Story editor and use them in your website’s layout.

Use studio.images.json beside package.json to give writers named sizes in the Story editor. Without named sizes, editors can still use Default and Custom width.

{
  "sizes": [
    { "value": "compact", "label": "Compact" },
    { "value": "full-column", "label": "Full article column" }
  ]
}
SettingValues and effect
sizesArray of choices in display order. An absent or empty list adds no named sizes.
sizes[].valueStable identifier written into Markdown, for example {size="full-column"}. Start with a lowercase letter, then use lowercase letters, digits, or hyphens. For duplicate identifiers, Studio uses the first valid choice.
sizes[].labelRequired, nonempty picker label. The identifiers compact, normal, and wide use Studio’s standard labels. Custom identifiers use your label.

A custom width is saved as {width="320px"} or {width="75%"}. A named size replaces an explicit width. Alignment is independent and uses align="left", "center", or "right". Have the site renderer read the image attributes and apply the corresponding layout.