quarto-dev / quarto-dev/quarto-r

Setting title via metadata in `quarto_render` does not work

Open
#181 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement upstream
Dominant language
R
Stars
161
Forks
29
Avg merge
3h 18m
Merged PRs (30d)
1

Description

Could be related to quarto-dev/quarto-cli#8987

when I try to set title via metadata like so:

quarto::quarto_render("template.qmd", metadata = list(title = "Hahaha", author = "Whoever"))

the title set in metadata is not used in the header block or HTML header (nor emitted correctly via {{< meta title >}} in the body) when a title is set in the document header. When there is no title entry in the YAML header, the title set in metadata is used and does appear in the body.

Setting e.g. the author via metadata works correctly.

Originally posted by @petrbouchal in https://github.com/quarto-dev/quarto-cli/issues/8987#issuecomment-2116261659

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.

Research direction

Start by reproducing the issue with quarto::quarto_render("template.qmd", metadata = list(title = "Hahaha", author = "Whoever")), comparing a document with and without a YAML title. Trace how the metadata reaches the rendered header, HTML header, and {{< meta title >}} output; done means metadata title overrides or is handled consistently when a document title is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.