pagetitle not correctly rendering inline chunk evaluation

Open
#1,436 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, r
Domain
tooling, web-dev

Research direction

Start with the standalone and website examples in the issue, using the inline R expression in a .qmd file and the website settings in _quarto.yml. Run the website render and compare the document title with the browser-tab pagetitle. Done means both titles evaluate the inline expression and the website tab shows “Test - 2”.

Written by the indexing model from the issue text.

Description

bug
Bug description

For stand alone Quarto documents, you can render them so that they have a title that evaluates an inline R chunk, i.e. this works:

---
title: "`r 1+1`"
format: html
---

## Quarto

and the title will be 2 (and also the pagetitle will be 2). This is expected behaviour.

However when this is a page in a website it no longer works. For example, if we have the following for our _quarto.yml file:

project:
  type: website

website:
  title: "Test"

Then the above page would have a title printed in the document of 2 but the pagetitle (title that appears in the browser tab) will be Test - r 1+1 when it should really be Test - 2.

If I try to set the pagetitle directly, it still doesn't render properly, for example, the following Quarto document (when it's in the Quarto website) will have a tab name of r 1+1.

---
pagetitle: "`r 1+1`"
format: html
---

## Quarto

It's interesting that title works (in the document) but pagetitle does not seem to be working as expected.

quarto check Output
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      Path: /Users/garthtarr/git/quarto-cli/package/dist/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.13
      Path: /usr/local/opt/python@3.9/bin/python3.9
      Jupyter: (None)

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

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/garthtarr/Library/R/x86_64/4.2/library
        - /Library/Frameworks/R.framework/Versions/4.2/Resources/library
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK
quarto tools check Output
[✓] Reading Tool Data
Tool                Status                          Installed     Latest        
tinytex             Not installed                   ----          v2022.07      
chromium            Not installed                   ----          869685    
Checklist
  • formatted your issue so it is easier for us to read?
  • included 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.
  • documented the quarto version you're running, by pasting the output from running quarto check in the "Quarto Check Output" text area?
  • documented the version of the quarto tools you're running, by providing the output from running quarto tools check in the "Quarto Tools Check Output" text area?
  • documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • documented which operating system you're running? If on Linux, please provide the specific distribution as well.
  • upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
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.