Skip to content
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

Giscus repo value ingested before variable resolution #11782

Open
ekiefl opened this issue Jan 3, 2025 · 0 comments
Open

Giscus repo value ingested before variable resolution #11782

ekiefl opened this issue Jan 3, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ekiefl
Copy link

ekiefl commented Jan 3, 2025

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

@ekiefl ekiefl added the bug Something isn't working label Jan 3, 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
Projects
None yet
Development

No branches or pull requests

1 participant