Categories injected via `quarto::write_yaml_metadata_block()` are not used in listing

Open
#13,483 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, r
Domain
tooling

Research direction

Start with the quarto::write_yaml_metadata_block entry point and the listing generation path, comparing the categories visible on an individual page with the metadata consumed by listings. Done means dynamically injected categories appear in listings and can be used to select posts, with a regression test covering the reported R example.

Written by the indexing model from the issue text.

Description

enhancement listings metadata

I am trying to dynamically generate tags (based on whether the date is in the past or not):

```{r}
#| label: metadata-block
#| output: asis
#| echo: false
quarto::write_yaml_metadata_block(
  # We leave 7 days of delay after the starting date to account for event duration
  categories = ifelse(
    isTRUE(Sys.Date() > as.Date(rmarkdown::metadata$date, optional = TRUE) + 7L),
    "Past",
    "Future"
  )
)
```

On each individual page, the resulting categories is correctly displayed but it seems this is not taken into account in the listing. The tags are not displayed and I cannot select posts by tags.

Is this immediately clear to you or would you like a repo with a reprex?

Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

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.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.