Giscus repo value ingested before variable resolution

Open
#11,782 0 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Jan 14, 2025.

Assessment

This issue has not been assessed yet.

Description

bug shortcodes triaged-to
Bug description

Giscus widget displays "An error occurred: giscus is not installed on this repository" when the repo YAML key is supplied with a quarto variable.

Inspecting the Giscus iframe reveals the src is

https://giscus.app/en/widget?origin=http%3A%2F%2Flocalhost%3A5093%2F&session=&theme=light&reactionsEnabled=1&emitMetadata=0&inputPosition=top&repo=%7B%7B%26lt%3B+var+repo_name+%26gt%3B%7D%7D&repoId=&category=General&categoryId=&strict=0&description=&backLink=http%3A%2F%2Flocalhost%3A5093%2F&term=index

Of note is %7B%7B%26lt%3B+var+repo_name+%26gt%3B%7D%7D, which indicates that Giscus is passed the repo value before Quarto resolves the variable.

I consider this a bug because in other instances, (e.g. hrefs), variable-containing strings in _quarto.yml are properly resolved.

Steps to reproduce

_quarto.yml:

project:
  type: website
comments:
  giscus:
    repo: "{{< var repo_name >}}"
    #repo: ekiefl/quarto-website-test

index.qmd:

---
---

# {{< var repo_name >}}

_variables.yml:

repo_name: ekiefl/quarto-website-test

Then run quarto preview.

Expected behavior

Variable resolves and the widget renders.

Actual behavior

Variable reference is treated literally and the widget receives the wrong src.

Your environment

No response

Quarto check output
Quarto 1.6.39
[✓] Checking environment information...
      Quarto cache location: /Users/evan/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.6.39
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2025.01
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/evan/Library/TinyTeX/bin/universal-darwin
      Version: 2024

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.2 (Conda)
      Path: /opt/miniconda3/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking R installation...........OK
      Version: 4.4.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
      knitr: 1.48
      rmarkdown: 2.28

[✓] Checking Knitr engine render......OK

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.