Skip to content

docs: explain how open-graph image-width and image-height apply - #2282

Merged
cderv merged 2 commits into
prereleasefrom
og-image-size
Oct 14, 2026
Merged

cderv merged 2 commits into
prereleasefrom
og-image-size

Conversation

@cderv

@cderv cderv commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Companion to quarto-dev/quarto-cli#15040, which fixes quarto-dev/quarto-cli#12016 for Quarto 1.11, and quarto-dev/quarto-cli#15050, which adds JPEG measurement.

The image rows of both social metadata tables said that image-width and image-height improve "your Twitter Card". Twitter Card metadata never uses a declared size, only Open Graph does. The Twitter Card row now points to the Open Graph section.

A new "Image Size" section under Open Graph explains how a declared size applies. With site-url set, Quarto measures local PNG and JPEG images and uses that size over a declared one, so declared sizes matter for remote images and formats Quarto can't measure, such as WebP or GIF. Sizes in website: open-graph describe the site image: a page that supplies its own image gets only the sizes in its own open-graph metadata, even when it repeats the site image.

That last part changes behavior for sites without site-url, where page images used to inherit the site sizes. The section shows how to restore them through page or _metadata.yml open-graph metadata.

This targets prerelease directly, as the behavior is new in 1.11.

The image rows of both social metadata tables said a declared
image-width/image-height improves "your Twitter Card". Twitter Card
metadata never reads a declared size; only Open Graph does.

With site-url set, Quarto measures PNG images and uses that size over a
declared one. From Quarto 1.11 (quarto-dev/quarto-cli#15040), a declared
size is kept for images Quarto can't measure (JPEG, SVG, ...), and a
page that brings its own image no longer inherits the size declared for
the site image. Explain both in the Open Graph table, and point the
Twitter Card row there instead.
@github-actions

Copy link
Copy Markdown
Contributor

📝 Preview Deployment

🔍 Full site preview: https://deploy-preview-2282.quarto.org

🔄 Modified Documents

The image row described only PNG measurement and suggested JPEG as a
case for declared sizes. Since quarto-dev/quarto-cli#15050, Quarto also
measures JPEG, so declared sizes only matter for remote images and
formats like WebP or GIF.

quarto-dev/quarto-cli#15040 also stops a page image from inheriting the
sizes declared in website: open-graph. The check is whether the page
supplies an image, not whether it differs from the site image, and only
the page's open-graph block is read, not top-level image-width/height.
Sites without site-url that used the site sizes as defaults lose those
tags, so document the migration through page or _metadata.yml
open-graph metadata, and note that directory sizes also apply to the
site image on pages without their own image.

All statements checked by rendering test sites with a 1.11 dev build
and with 1.10.19.
@github-actions

Copy link
Copy Markdown
Contributor

📝 Preview Deployment

🔍 Full site preview: https://deploy-preview-2282.quarto.org

🔄 Modified Documents

@cderv
cderv merged commit 0771713 into prerelease Oct 14, 2026
3 checks passed
@cderv
cderv deleted the og-image-size branch October 14, 2026 12:13
cderv added a commit to quarto-dev/quarto-cli that referenced this pull request Oct 15, 2026
Remove the top-level `image-width` and `image-height` options, which
nothing read. Open Graph sizes come from `open-graph` or from
measuring the image. Because the schema typed them as strings, a
numeric value such as `image-width: 1200` failed the render, for an
option that did nothing. Wiring them up was rejected: the same names
already size the about-page image, so a top-level meaning would be
ambiguous.

- Remove both keys from the website document schema. Front matter
  accepts undeclared keys, so numeric and string values now render
  and are ignored.
- Point the `image` option description at `open-graph` for declaring
  the preview image size.

See #15040 and quarto-dev/quarto-web#2282 for the sizing rules and
the existing "aren't used" note.

Related to #12016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant