Skip to content

Fix twitter-card image size tags and options - #15085

Merged
cderv merged 5 commits into
mainfrom
fix/measured-image-size-emitted-as
Oct 16, 2026
Merged

cderv merged 5 commits into
mainfrom
fix/measured-image-size-emitted-as

Conversation

@cderv

@cderv cderv commented Oct 16, 2026

Copy link
Copy Markdown
Member

Follow-up to #15083, from the same pass over the image-* options.

With site-url set, the size Quarto measures from a local PNG or JPEG image was written to every social metadata provider. The twitter provider passed it through as twitter:image-height and twitter:image-width, which are not Twitter Card tags: Twitter Cards define only twitter:image and twitter:image:alt for images. The PNG case dates back to 2021, and #15050 extended it to JPEG. Crawlers ignore unknown meta names, so the impact is cosmetic. The measured size now goes to og:image:height and og:image:width only.

The twitter-card image-width and image-height options come from the same mix-up (#12014). twitter-card shared its options with open-graph, so the two showed in the reference although nothing reads them. They move to open-graph. On twitter-card they stay accepted as hidden options, since it is a closed object and removing them would turn a harmless no-op into a failed render for any config that sets them. Setting them prints a warning that they are ignored and points to open-graph, without announcing a removal.

The #15050 changelog entry no longer claims twitter:image gets a height and width.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

Fixes #12014

cderv added 5 commits October 16, 2026 12:21
With site-url set and both social cards enabled, a page image Quarto can
measure gets twitter:image-height and twitter:image-width tags. Twitter
Cards define no image size tags, only twitter:image and twitter:image:alt,
so the measured size belongs on og:image alone.
With site-url set, the size measured from a local PNG or JPEG image was
written to every social metadata provider, and the twitter provider passed
the keys through unchanged as twitter:image-height and twitter:image-width.
Twitter Cards define only twitter:image and twitter:image:alt for images,
so the size now goes to Open Graph alone, as og:image:height/width.

The PNG case dates back to 2021 and shows in 1.10; measuring JPEG images
in this release extended it to JPEG. A test page relying on the site image
covers the fallback path too.
twitter-card accepted image-width and image-height because it shared its
options with open-graph, so they showed in the reference although Twitter
Cards have no image size tags and nothing ever read them (#12014).

Removing them outright would fail the render of any config setting them,
as twitter-card is a closed object. They now move to open-graph, stay
accepted on twitter-card as hidden options (no completion, and the
reference generator skips hidden options), and setting them prints a
deprecation warning pointing to open-graph. A future version can drop
them.

The warning test renders the file alone: warnOnce is per process, so a
project pre-render would consume the message.
Removing the hidden twitter-card image-width and image-height later would
turn a harmless no-op into a failed render, while keeping them hidden costs
nothing (the legacy archive_* keys stay accepted the same way). The warning
now says the options are ignored and points to open-graph, without
announcing a removal.
The #15050 entry no longer claims twitter:image gets a height and width,
as the measured size now goes to og:image only.
@posit-snyk-bot

posit-snyk-bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv
cderv merged commit 8567cec into main Oct 16, 2026
51 checks passed
@cderv
cderv deleted the fix/measured-image-size-emitted-as branch October 16, 2026 11:00
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.

image-width and image-height not working with twitter-card

2 participants