quarto-dev / quarto-dev/quarto-cli

environment variables not substituted with empty title

Open
#13,550 3 comments 0 reactions 2 assignees View on GitHub

@cderv is already working on this.

Since Oct 17, 2025.

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

Description

I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

This is related to https://github.com/quarto-dev/quarto-cli/issues/7754.

When the Quarto website title includes the environment variable shortcode and the (not default) page does not include a title, substitution does not occur.

This is a regression from Quarto 1.4.

Steps to reproduce
project:
  type: website

website:
  title: "{{< env SITE_TITLE >}}"
---
title: "index"
---

this is index.qmd
---
title: ""
---

this is about.qmd
 SITE_TITLE="hiya" ~/quarto/quarto-1.4.557-macos/bin/quarto render --output-dir _site_1.4
 SITE_TITLE="hiya" ~/quarto/quarto-1.5.57-macos/bin/quarto render --output-dir _site_1.5
 SITE_TITLE="hiya" ~/quarto/quarto-1.6.43-macos/bin/quarto render --output-dir _site_1.6
 SITE_TITLE="hiya" ~/quarto/quarto-1.7.34-macos/bin/quarto render --output-dir _site_1.7
 SITE_TITLE="hiya" ~/quarto/quarto-1.8.25-macos/bin/quarto render --output-dir _site_1.8

Looking across all of the generated HTML:

grep '<title' _site*/about.html

Only Quarto 1.4 replaces the environment variable.

_site_1.4/about.html:<title>hiya -</title>
_site_1.5/about.html:<title>about – {{&lt; env SITE_TITLE &gt;}}</title>
_site_1.6/about.html:<title>about – {{&lt; env SITE_TITLE &gt;}}</title>
_site_1.7/about.html:<title>about – {{&lt; env SITE_TITLE &gt;}}</title>
_site_1.8/about.html:<title>about – {{&lt; env SITE_TITLE &gt;}}</title>

To workaround, use title-prefix and pagetitle.

---
title-prefix: ""
pagetitle: '{{< env SITE_TITLE >}} the fix'
---

this is about.qmd
Actual behavior

Environment variables are not substituted.

Expected behavior

Environment variables are not substituted.

Your environment

Tested with multiple Quarto versions (see above).

Quarto check output
Quarto 1.8.25
[✓] Checking environment information...
      Quarto cache location: /Users/aron/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.3.1: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.8.25
      Path: /Users/aron/quarto/quarto-1.8.25-macos/bin

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

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /Library/TeX/texbin
      Version: 2024

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /opt/homebrew/opt/python@3.12/bin/python3.12
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.3.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.50
      rmarkdown: 2.29

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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.