Skip to content

Fix listing feed image size depending on the render directory - #15032

Open
cderv wants to merge 2 commits into
mainfrom
fix/listing-feed-image-size-lookup
Open

cderv wants to merge 2 commits into
mainfrom
fix/listing-feed-image-size-lookup

Conversation

@cderv

@cderv cderv commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

When a website project is rendered from outside its directory (quarto render path/to/project), the listing feed <image> silently loses its <height> and <width>. Rendering the same project from inside its directory keeps them. A feed image written with a leading / (image: /feed.png) never gets them, whatever the directory.

Found while reviewing #15026, but the bug predates it.

Root cause

createFeed passes the feed image (listing feed: image:, the document image, or the site image) unchanged to imageSize() in website-listing-feed.ts, so a relative path is read from the current working directory instead of the project. The feed <url> for the same image is built project-relative with absoluteUrl(), and per-item images in the same file already join project.dir before reading their size.

Fix

The size is now read from join(project.dir, image), the same project file the feed <url> points at. Rendering from the project directory gives the same output as before.

The new smoke test renders a fixture project from the tests/ directory and checks the size for the listing option, the site image fallback and a leading / path.

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, DeepWiki MCP
  • 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.

createFeed passed the raw feed image (listing feed.image, document image,
or website image) to imageSize, so a relative path resolved against the
process cwd. Rendering a project from outside its directory
(quarto render path/to/project) silently dropped <height>/<width> from the
feed <image>, and a leading "/" path read from the drive root on every
render.

The feed <url> already treats the image as project-relative through
absoluteUrl, and per-item images already join project.dir, so the size is
now read from that same project file. Renders from the project directory
produce the same output as before.

The smoke test renders a fixture project from the tests directory and
checks the listing option, the site image fallback and a leading "/" path.
@posit-snyk-bot

posit-snyk-bot commented Oct 12, 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.

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.

2 participants