Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ All changes included in 1.11:
- ([#14974](https://github.com/quarto-dev/quarto-cli/issues/14974)): Fix math in `.llms.md` files from `llms-txt` coming out garbled with the default `mathjax` method, and with `katex` and `webtex`. Math is now written as `$...$` and `$$...$$` with the `mathjax`, `katex`, `webtex` and `mathml` methods.
- ([#15004](https://github.com/quarto-dev/quarto-cli/issues/15004)): Fix notebook preview pages and notebook sources missing from the output directory when a website with embedded notebooks is rendered from a directory other than the project directory.
- ([#15022](https://github.com/quarto-dev/quarto-cli/issues/15022)): Fix rendering a listing with a `feed` failing on Windows with `os error 123` when a listing item's `image` or the feed `image` is a web URL. The image URL is used as is in the feed and no local size lookup is attempted. (author: @Masad791)
- ([#15032](https://github.com/quarto-dev/quarto-cli/pull/15032)): Fix the listing feed `image` missing its height and width when a website is rendered from a directory other than the project directory, or when the image path starts with `/`.

## Lua API

Expand Down
5 changes: 4 additions & 1 deletion src/project/types/website/listing/website-listing-feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ export async function createFeed(
link: link,
url: absoluteUrl(siteUrl, image),
};
const size = isAbsoluteRef(image) ? undefined : imageSize(image);
// Read the size from the project file the url points at, not the cwd
const size = isAbsoluteRef(image)
? undefined
: imageSize(join(project.dir, image));
if (size) {
const [height, width] = feedImageSize(size.height, size.width);
feed.image.height = height;
Expand Down
4 changes: 4 additions & 0 deletions tests/docs/listings-feed-image/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.quarto/
_site/

**/*.quarto_ipynb
7 changes: 7 additions & 0 deletions tests/docs/listings-feed-image/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
project:
type: website

website:
title: "listings-feed-image"
site-url: https://example.com
image: feed.png
7 changes: 7 additions & 0 deletions tests/docs/listings-feed-image/archive/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Feed image from the site"
listing:
feed: true
---

This listing sets no image, so the feed falls back to the site `image`.
6 changes: 6 additions & 0 deletions tests/docs/listings-feed-image/archive/post.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "An archived post"
date: "2026-10-12"
---

A post listed by the archive feed.
Binary file added tests/docs/listings-feed-image/feed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions tests/docs/listings-feed-image/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "Feed image from the listing option"
listing:
contents: posts
feed:
image: feed.png
---

The feed image comes from the listing `feed: image:` option.
6 changes: 6 additions & 0 deletions tests/docs/listings-feed-image/posts/post.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "A post"
date: "2026-10-12"
---

A post listed by the root feed.
8 changes: 8 additions & 0 deletions tests/docs/listings-feed-image/updates/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "Feed image with a leading slash"
listing:
feed:
image: /feed.png
---

The feed image is given relative to the project root with a leading `/`.
6 changes: 6 additions & 0 deletions tests/docs/listings-feed-image/updates/post.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "An update"
date: "2026-10-12"
---

A post listed by the updates feed.
40 changes: 40 additions & 0 deletions tests/smoke/site/render-listing-feed-image.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* render-listing-feed-image.test.ts
*
* Copyright (C) 2026 Posit Software, PBC
*/
import { join } from "../../../src/deno_ral/path.ts";
import { removeIfExists } from "../../../src/core/path.ts";
import { testQuartoCmd, Verify } from "../../test.ts";
import { docs } from "../../utils.ts";
import { ensureFileRegexMatches, noErrorsOrWarnings } from "../../verify.ts";

// The project is rendered from the test cwd, not from its own directory, so
// the feed image size must be read relative to the project, not the cwd.
const projectDir = docs("listings-feed-image");
const outputDir = join(projectDir, "_site");

// feed.png is 600x400, scaled down to fit the RSS 144px maximum width.
const feedImage = [
/<image>\s*<url>https:\/\/example\.com\/feed\.png<\/url>/,
/<height>96<\/height>\s*<width>144<\/width>\s*<\/image>/,
];

const verify: Verify[] = [
noErrorsOrWarnings,
// Listing `feed: image:` option
ensureFileRegexMatches(join(outputDir, "index.xml"), feedImage),
// Site `image` fallback
ensureFileRegexMatches(join(outputDir, "archive", "index.xml"), feedImage),
// Project-relative path with a leading slash
ensureFileRegexMatches(join(outputDir, "updates", "index.xml"), feedImage),
];

testQuartoCmd("render", [projectDir], verify, {
name: "Listing feed image size is read relative to the project",
teardown: () => {
removeIfExists(outputDir);
removeIfExists(join(projectDir, ".quarto"));
return Promise.resolve();
},
});
Loading