Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/project/types/website/listing/website-listing-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
)
Expand Down
21 changes: 21 additions & 0 deletions tests/docs/smoke-all/2025/03/07/issue-12222/_quarto.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions tests/docs/smoke-all/2025/03/07/issue-12222/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "Listing Example"
listing:
contents: posts
sort: "date desc"
_quarto:
render-project: true
tests:
html:
ensureFileRegexMatches:
-
- '\<img src="posts[/|\\]post-with-code[/|\\]image.jpg'
- '\<img src="posts[/|\\]welcome[/|\\]thumbnail.jpg'
- []
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
date: '2025-03-06T14:38:55+09:00'
title: "Yes, meta image but empty"
_quarto:
render-project: true
tests:
html:
ensureFileRegexMatches:
-
- '\<meta name="twitter:image" content="../..[/|\\]posts/welcome/thumbnail.jpg'
- '\<meta property="og:image" content="../..[/|\\]posts/welcome/thumbnail.jpg'
- []
image: ""
---

Testing images.

![](/posts/welcome/thumbnail.jpg)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
date: '2025-03-06T14:38:55+09:00'
title: "This has no meta image"
_quarto:
render-project: true
tests:
html:
ensureFileRegexMatches:
-
- '\<meta name="twitter:image" content="../..[/|\\]posts/post-with-code/image.jpg'
- '\<meta property="og:image" content="../..[/|\\]posts/post-with-code/image.jpg'
- []
---

Testing images.

![](/posts/post-with-code/image.jpg)
Loading