Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 of 5 tasks
e-alizadeh opened this issue May 17, 2023 · 13 comments
Labels
bug Something isn't working listings shortcodes issues related to shortcodes
Milestone

Comments

@e-alizadeh
Copy link

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.
@e-alizadeh e-alizadeh added the bug Something isn't working label May 17, 2023
@cscheid
Copy link
Collaborator

cscheid commented May 17, 2023

We just fixed this in 1.4.70.

@cscheid cscheid closed this as completed May 17, 2023
@cscheid cscheid added the duplicate This issue or pull request already exists label May 17, 2023
@cscheid
Copy link
Collaborator

cscheid commented May 17, 2023

(See #5534)

@e-alizadeh
Copy link
Author

e-alizadeh commented May 17, 2023

@cscheid I've updated my Quarto to 1.4.70, deleted _site directory and re-run quarto preview <deducted>/website/index.qmd --no-browser --no-watch-inputs. The issue above is still there. That's on my local computer.

In my website (Netlify + GitHub Actions), I'm using the action quarto-dev/quarto-actions/setup@v2 with version: pre-release which should technically pick the latest version. However, I still see the unparsed categories in the RSS fields, even though I had a few deployments since yesterday!

@mcanouil
Copy link
Collaborator

You can check in your CI log which version of Quarto has been used.

So please do confirm, 1.4.70 did not solve this.

Additionally, please consider sharing a small "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks.

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)
```

The end.
````

@cscheid
Copy link
Collaborator

cscheid commented May 17, 2023

To be clear, this is what I see locally:

image

@e-alizadeh
Copy link
Author

The tags in the frontmatter of the page works fine for me too. The issue is when categories: true in the listing configuration and also when generating the RSS field.
I don't have access to my laptop, but I will test it again tonight.

@cscheid
Copy link
Collaborator

cscheid commented May 17, 2023

Can you share your full failing example?

@e-alizadeh
Copy link
Author

e-alizadeh commented May 19, 2023

@cscheid
quarto_test.zip compressed file contains a reproducible example. You can see the file content in below screenshot too.
Screenshot 2023-05-18 at 8 20 24 PM

Result

Blog listing page

Screenshot 2023-05-18 at 8 18 30 PM

Post page

image

As you can see in the listings, the categories are not parsed. That's one issue. The other issue is in the feed (index.xml) file. The content is not parsed there as well, however I couldn't reproduce this for this sample. Anyway, you can find it on my website RSS file (https://ealizadeh.com/index.xml).

I believe this issue is indeed a bug that wasn't fully resolved!

@cscheid
Copy link
Collaborator

cscheid commented May 19, 2023

Thanks for the reproducible example. I can reproduce parts of it here.

The other issue is in the feed (index.xml) file. The content is not parsed there as well, however I couldn't reproduce this for this sample.

I'm not seeing index.xml being generated here, because, as you can see in the rendering, you need to configure site-url:

[2/2] index.qmd
WARNING: Unable to create a feed as the required `site-url` property is missing from this project.

I can see the category title shortcodes not being resolved; I'll investigate more and fix.

@e-alizadeh
Copy link
Author

e-alizadeh commented May 19, 2023

Thanks a lot. That's why I had the RSS feed for my actual blog but not for this sample Quarto project. Anyway, the category variables are not resolved in the RSS XML file as well.
Screenshot 2023-05-18 at 10 36 17 PM

Should this ticket be opened again?

@cscheid cscheid reopened this May 19, 2023
@cscheid
Copy link
Collaborator

cscheid commented May 19, 2023

The problem here is not on the front matter itself. The problem is on listing items derived from front matter, which currently do not go through pandoc processing.

Unfortunately, that requires larger changes in our system, so I don't have a fast solution for you.

@mcanouil
Copy link
Collaborator

I see this issue has the “duplicate” label, but is it still?

@kMygUfvVdbVsuvYjNcZEQEMrMpecJL kMygUfvVdbVsuvYjNcZEQEMrMpecJL added this to the Future milestone Jun 15, 2023
@mcanouil mcanouil added listings and removed duplicate This issue or pull request already exists labels Mar 20, 2024
@mcanouil
Copy link
Collaborator

mcanouil commented May 5, 2025

@mcanouil mcanouil added the shortcodes issues related to shortcodes label May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working listings shortcodes issues related to shortcodes
Projects
None yet
Development

No branches or pull requests

4 participants