diff --git a/src/project/types/website/listing/website-listing-read.ts b/src/project/types/website/listing/website-listing-read.ts index 40e454b1dd6..5281001eedc 100644 --- a/src/project/types/website/listing/website-listing-read.ts +++ b/src/project/types/website/listing/website-listing-read.ts @@ -1123,7 +1123,7 @@ async function listItemFromFile( descriptionPlaceholder(inputTarget?.outputHref, maxDescLength); const imageRaw = documentMeta?.image as string | boolean; - const image = imageRaw !== undefined && typeof imageRaw === "string" + const image = imageRaw && typeof imageRaw === "string" ? pathWithForwardSlashes( listingItemHref(imageRaw, dirname(projectRelativePath)), ) diff --git a/tests/docs/smoke-all/2025/03/07/issue-12222/_quarto.yml b/tests/docs/smoke-all/2025/03/07/issue-12222/_quarto.yml new file mode 100644 index 00000000000..21427674406 --- /dev/null +++ b/tests/docs/smoke-all/2025/03/07/issue-12222/_quarto.yml @@ -0,0 +1,21 @@ +project: + type: website + +website: + title: "myblog" + twitter-card: true + open-graph: true + page-footer: + center: | + Footer image: + [![](/profile.jpg)](https://quarto.org/) + navbar: + right: + - icon: github + href: https://github.com/ + - icon: twitter + href: https://twitter.com + +format: + html: + theme: cosmo diff --git a/tests/docs/smoke-all/2025/03/07/issue-12222/index.qmd b/tests/docs/smoke-all/2025/03/07/issue-12222/index.qmd new file mode 100644 index 00000000000..e0e42709a3f --- /dev/null +++ b/tests/docs/smoke-all/2025/03/07/issue-12222/index.qmd @@ -0,0 +1,15 @@ +--- +title: "Listing Example" +listing: + contents: posts + sort: "date desc" +_quarto: + render-project: true + tests: + html: + ensureFileRegexMatches: + - + - '\