quarto-dev / quarto-dev/quarto-cli

`draft` list in `metadata-files` is ignored

Open
#10,572 0 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Aug 21, 2024.

bug metadata
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/10568

Originally posted by andrewpbray August 20, 2024

Description

Hello! I'm running into a puzzling issue when trying to create a metadata extension. I have an extension that I'd like to add metadata-files to the _quarto.yml to set a draft list.

contributes:
  metadata:
    project:
      output-dir: _mysite
    metadata-files:
      - draft-list.yml

When I render this website, the draft list does not appear to have taken effect. It will work, however, if I adjust _quarto.yml to read:

project:
  type: website

website:
  sidebar: 
    contents: 
      - index.qmd
      - about.qmd

metadata-files:
  - draft-list.yml

Which suggests the issue is in merging the metadata-files key in from the extension (the output-dir does take effect).

Minimal example is here: https://github.com/andrewpbray/reprex-metadata-merge

The docs on metadata extensions state "Currently, metadata extensions only merge project-level metadata. This limitation will be lifted in the future." I had assumed "project-level metadata" is anything that appears in _quarto.yml but perhaps its only the keys that are accepted under the project key. I've tried shifting metadata-files so that it's not under the metadata key, but still no luck.

The real use-case here is the scheduled-docs extension. It has a pre and post render script (that run just fine) that generate a draft-list.yml that I'd like to automatically get merge into _quarto.yml without the user needing to manually modify their _quarto.yml.

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.