quarto-dev / quarto-dev/quarto-cli

Some metadata set in `_metadata.yml` and in YAML header inside document are not correctly merged.

Open
#9,864 5 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Oct 22, 2024.

authors bug metadata yaml-validation
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/9855

Originally posted by McKabue June 3, 2024

/posts/welcome/index.qmd

---
title: "Welcome To My Blog"
date: "2024-05-01"
categories: [news]
author: "martin from welcome"
---

This is the first post in a Quarto blog. Welcome!

![](thumbnail.jpg)

Since this post doesn't specify an explicit `image`, the first image in the post will be used in the listing page of posts.

/posts/_metadata.yml

categories: [tech]
author:
  - name: James from posts

With the above setup, I get the following post and listing:

Screenshot 2024-06-03 at 22 21 52 Screenshot 2024-06-03 at 22 22 14

However, if:

/posts/welcome/index.qmd

---
title: "Welcome To My Blog"
date: "2024-05-01"
---

This is the first post in a Quarto blog. Welcome!

![](thumbnail.jpg)

Since this post doesn't specify an explicit `image`, the first image in the post will be used in the listing page of posts.

/posts/welcome/_metadata.yml

categories: [news]
author: "martin from welcome"

/posts/_metadata.yml

categories: [tech]
author:
  - name: James from posts

I get the following post and listing:

Screenshot 2024-06-03 at 22 25 43 Screenshot 2024-06-03 at 22 25 54

When the metadata is in the document file, it overwrites all parent metadata such as authors and categories instead of extending it in the post page.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.