Skip to content

environment variables not substituted with empty title #13550

@aronatkins

Description

@aronatkins

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 #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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions