From f60a9ff4a59101e7722d67b1b0b6f399d046eedd Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Mon, 7 Apr 2025 14:01:42 -0400 Subject: [PATCH 1/2] yaml - default empty metadafile to {} --- src/project/project-shared.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/project/project-shared.ts b/src/project/project-shared.ts index bef495a34d..5ddab4a280 100644 --- a/src/project/project-shared.ts +++ b/src/project/project-shared.ts @@ -329,6 +329,7 @@ export async function directoryMetadataForInputFile( file, frontMatterSchema, errMsg, + "{}", )) || {}) as Record; // resolve format into expected structure @@ -611,7 +612,7 @@ export async function projectResolveBrand( } if (typeof brand.dark === "string") { dark = await loadRelativeBrand(brand.dark); - } else if(brand.dark) { + } else if (brand.dark) { dark = new Brand( brand.dark, dirname(fileName), From 6f112ac1d4922f41499d3b7f734490d2144ed784 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Mon, 7 Apr 2025 14:03:22 -0400 Subject: [PATCH 2/2] regression test/changelog --- news/changelog-1.7.md | 1 + tests/docs/smoke-all/2025/04/07/issue-5600/_metadata.yml | 0 tests/docs/smoke-all/2025/04/07/issue-5600/_quarto.yml | 0 tests/docs/smoke-all/2025/04/07/issue-5600/index.qmd | 0 4 files changed, 1 insertion(+) create mode 100644 tests/docs/smoke-all/2025/04/07/issue-5600/_metadata.yml create mode 100644 tests/docs/smoke-all/2025/04/07/issue-5600/_quarto.yml create mode 100644 tests/docs/smoke-all/2025/04/07/issue-5600/index.qmd diff --git a/news/changelog-1.7.md b/news/changelog-1.7.md index d8540c0c72..738b7db9ce 100644 --- a/news/changelog-1.7.md +++ b/news/changelog-1.7.md @@ -29,6 +29,7 @@ All changes included in 1.7: ### `website` +- ([#5600](https://github.com/quarto-dev/quarto-cli/issues/5600)): Allow existing-but-empty `_metadata.yml` file in projects. - ([#8238](https://github.com/quarto-dev/quarto-cli/issues/8238)): Listing categories are now sorted case-insensitively. - ([#10501](https://github.com/quarto-dev/quarto-cli/issues/10501)): Improve documentation of `repo-actions` option. - ([#11701](https://github.com/quarto-dev/quarto-cli/issues/11701)): Wrap HTML emitted by EJS templates in `{=html}` blocks to avoid memory blowup issues with Pandoc's parser. diff --git a/tests/docs/smoke-all/2025/04/07/issue-5600/_metadata.yml b/tests/docs/smoke-all/2025/04/07/issue-5600/_metadata.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/docs/smoke-all/2025/04/07/issue-5600/_quarto.yml b/tests/docs/smoke-all/2025/04/07/issue-5600/_quarto.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/docs/smoke-all/2025/04/07/issue-5600/index.qmd b/tests/docs/smoke-all/2025/04/07/issue-5600/index.qmd new file mode 100644 index 0000000000..e69de29bb2