quarto-dev / quarto-dev/quarto-cli
Some metadata set in `_metadata.yml` and in YAML header inside document are not correctly merged.
Open
@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!

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:
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!

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:
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.