From d2b180fd7fb923b2fe99bb6a36e3738e8f0ce87a Mon Sep 17 00:00:00 2001 From: yhkee0404 Date: Thu, 6 Mar 2025 16:13:32 +0000 Subject: [PATCH 1/4] Ignore empty meta image from website listing item as pageMetadata does --- src/project/types/website/listing/website-listing-read.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)), ) From 0d154b4fa6438b1afd5fb8bba13ed397e873169d Mon Sep 17 00:00:00 2001 From: yhkee0404 Date: Thu, 6 Mar 2025 16:40:04 +0000 Subject: [PATCH 2/4] Add tests/docs/smoke-all/2025/03/07/issue-12222 --- .../2025/03/07/issue-12222/_quarto.yml | 21 +++++++++++++++++++ .../2025/03/07/issue-12222/index.qmd | 15 +++++++++++++ .../autoImg-and-empty-meta-image/index.qmd | 18 ++++++++++++++++ .../posts/autoImg-and-no-meta-image/index.qmd | 17 +++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 tests/docs/smoke-all/2025/03/07/issue-12222/_quarto.yml create mode 100644 tests/docs/smoke-all/2025/03/07/issue-12222/index.qmd create mode 100644 tests/docs/smoke-all/2025/03/07/issue-12222/posts/autoImg-and-empty-meta-image/index.qmd create mode 100644 tests/docs/smoke-all/2025/03/07/issue-12222/posts/autoImg-and-no-meta-image/index.qmd 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..3534bc42562 --- /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: + - + - '\ Date: Thu, 6 Mar 2025 19:10:21 +0000 Subject: [PATCH 4/4] Try support windows path in ensureFileRegexMatches --- tests/docs/smoke-all/2025/03/07/issue-12222/index.qmd | 4 ++-- .../posts/preview-image-and-empty-meta-image/index.qmd | 4 ++-- .../posts/preview-image-and-no-meta-image/index.qmd | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 index 3534bc42562..e0e42709a3f 100644 --- a/tests/docs/smoke-all/2025/03/07/issue-12222/index.qmd +++ b/tests/docs/smoke-all/2025/03/07/issue-12222/index.qmd @@ -9,7 +9,7 @@ _quarto: html: ensureFileRegexMatches: - - - '\