quarto-dev / quarto-dev/quarto-cli

Variables in categories (in frontmatter) do not parse properly when `categories` is set to true in listing

Open
#5,578 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug description

I'm using variables for categories in the listing, they are properly parsed on the post page and the grid listing, however, they are not properly parsed in the following cases:

My setup

In the .qmd file of the post, the frontmatter contains the following:

---
title: "ABC"
categories: 
    - "{{< var kws.ds >}}"
    - "{{< var kws.ml >}}"
    -  "{{< var kws.nlp >}}"
    - "{{< var kws.python_pkg >}}"
    - AI 
---

Here is the content of the post. 

And these variables are defined in the _variables.yml file, like the following:

kws:
  ds: Data Science
  ml: Machine Learning
  nlp: Natural Language Processing
  python: Python
  python_pkg: Python Library

Issues

  • RSS feed:
    Screenshot 2023-05-16 at 9 10 10 PM

  • When categories: true in listing as can be seen below:
    Screenshot 2023-05-16 at 9 03 41 PM

App/system versions:

I'm using Quarto v1.4.37 in my VSCode v1.76.0 on macOS (13.3.1).

The output of quarto check is:

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.2: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.37
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.0 (Conda)
      Path: /Users/essi/miniconda3/envs/s2s/bin/python
      Jupyter: 5.3.0
      Kernels: s2s, openai, python3

(\) Checking Jupyter engine render....Unable to load extension: pydevd_plugins.extensions.types.pydevd_plugin_pandas_types
[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
Checklist
  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.

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.

Research direction

Start with the .qmd frontmatter and _variables.yml example, then reproduce the bug with a listing using categories: true and the RSS output. Trace where category variable expansion is handled in these listing paths; done means the rendered categories and RSS entries use resolved values consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, yaml
Domain
content
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.