Repository navigation
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
(I think this might be related to #13247)
When using a custom title-block.html template partial, the title-block-header header element is created incorrectly, even if using the default title-block.html file directly from the documentation.
Steps to reproduce
Here's how to reproduce. First, here's the expected output:
With this index.qmd:
---
title: "I am a title"
subtitle: "I am a subtitle"
date: 2026-01-03
---
Here's some text.…and this _quarto.yml:
project:
type: website
website:
title: "A neat website"
…the title area renders like this:
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">I am a title</h1>
<p class="subtitle lead">I am a subtitle</p>
</div>
<div class="quarto-title-meta">
<div>
<div class="quarto-title-meta-heading">Published</div>
<div class="quarto-title-meta-contents">
<p class="date">January 3, 2026</p>
</div>
</div>
</div>
</header>
Actual behavior
To break things, use this for index.qmd:
---
title: "I am a title"
subtitle: "I am a subtitle"
date: 2026-01-03
format:
html:
template-partials:
- title-block.html
---
Here's some text.…and this for title-block.html. This comes directly from src/resources/formats/html/pandoc/title-block.html and is the file linked from the documentation on HTML template partials
<header id="title-block-header">
$if(title)$<h1 class="title">$title$</h1>$endif$
$if(subtitle)$
<p class="subtitle">$subtitle$</p>
$endif$
$for(author)$
<p class="author">$author$</p>
$endfor$
$if(date)$
<p class="date">$date$</p>
$endif$
$if(abstract)$
<div class="abstract">
<div class="abstract-title">$abstract-title$</div>
$abstract$
</div>
$endif$
</header>The title area now renders like this:
<header id="title-block-header" class="quarto-title-block">
<h1 class="title display-7">I am a title</h1>
</header>
<header id="title-block-header">
<p class="subtitle lead">I am a subtitle</p>
<p class="date">January 3, 2026</p>
</header>with each title element (title, subtitle + date) wrapped in a separate div with the id title-block-header. Additionally, the date doesn't get any of the special Quarto additions like quarto-title-meta-contents.
Expected behavior
Based on the documentation, it seems like using the default title-block.html should create the same header area, but using it somehow bypasses lots of the extra Quarto processing like handling metadata, etc., so that in the end it creates two title-block-header divs, which shouldn't happen.
Your environment
- Positron Version: 2025.12.2 build 5 (though this happens in RStudio and the terminal too—it's not IDE-dependent)
- macOS Tahoe 26.1
Quarto check output
❯ quarto check
Quarto 1.9.16
[✓] Checking environment information...
Quarto cache location: /Users/andrew/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.4.5: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.9.16
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/andrew/Library/TinyTeX/bin/universal-darwin
Version: 2025
[✓] 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 R installation...........OK
Version: 4.5.2
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Users/andrew/Library/R/arm64/4.5/library
- /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
knitr: 1.50
rmarkdown: 2.30
[✓] Checking Knitr engine render......OK
[✓] Checking Python 3 installation....OK
Version: 3.13.1
Path: /Users/andrew/.virtualenvs/quarto/bin/python3
Jupyter: 5.7.2
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking Julia installation...I believe this to be a documentation issue but not limited to it.
Unfortunately the path pattern for partials is not consistent from one format to another which is likely the reason of this issue.
Here is the current situation:
- Typst:
- Pandoc:
src/resources/formats/typst/pandoc - Quarto:
src/resources/formats/typst/pandoc/quarto
- Pandoc:
- Beamer:
- Pandoc+Quarto:
src/resources/formats/beamer/pandoc
- Pandoc+Quarto:
- LaTeX:
- Pandoc+Quarto:
src/resources/formats/pdf/pandoc
- Pandoc+Quarto:
- HTML:
- Pandoc:
src/resources/formats/html/pandoc - Quarto:
src/resources/formats/html/templates- this contains the real title-block partial used by Quarto (the other partials are inpandocdirectory), note that there are several discussions about…
- Pandoc:
Activity
andrewheiss commentedon Jan 3, 2026
Huh, hang on, this might be (1) a me issue or (2) a documentation issue. If I use
src/resources/formats/html/templates/title-block.htmlinstead of thesrc/resources/formats/html/pandoc/title-block.htmlthat is linked from the documentation, everything works as expected because that file has all the quarto specific stuff in it:If I use that as
title-block.html, everything renders correctly.I only found that by hunting around in the
src/resources/formats/htmlfolder and searching the Quarto repository for "quarto-title-meta-contents" to see where that might be getting injected. But maybe I missed it in the documentation!Better template partial handling for the custom date section
mcanouil commentedon Jan 4, 2026
I believe this to be a documentation issue but not limited to it.
Unfortunately the path pattern for partials is not consistent from one format to another which is likely the reason of this issue.
Here is the current situation:
src/resources/formats/typst/pandocsrc/resources/formats/typst/pandoc/quartosrc/resources/formats/beamer/pandocsrc/resources/formats/pdf/pandocsrc/resources/formats/html/pandocsrc/resources/formats/html/templates- this contains the real title-block partial used by Quarto (the other partials are inpandocdirectory), note that there are several discussions about this being an issue when trying to customise the title-block)src/resources/formats/revealjs/pandocFor HTML, the
title-block.htmlbeing used depend on several options which makes it not as trivial as the documentation implies:src/resources/formats/html/templates/title-block.htmlquarto-cli/src/format/html/format-html-title.ts
Lines 159 to 167 in 06697fa
src/resources/formats/html/templates/title-block.htmlquarto-cli/src/format/html/format-html-title.ts
Lines 159 to 167 in 06697fa
src/resources/formats/html/templates/manuscript/title-block.htmlquarto-cli/src/format/html/format-html-title.ts
Lines 159 to 162 in 06697fa
quarto-cli/src/format/html/format-html-title.ts
Lines 136 to 143 in 06697fa
src/resources/formats/html/pandoc/title-block.htmlquarto-cli/src/format/html/format-html.ts
Lines 632 to 642 in 06697fa
src/resources/formats/html/templates/banner/title-block.htmlquarto-cli/src/format/html/format-html-title.ts
Lines 162 to 165 in 06697fa
cwickham commentedon Aug 21, 2026
I've split the documentation side of this (which title-block partials exist, where they live, and when each one is used) into a separate issue: #14794. It has one correction to the table above: the
none or falserow is not quite right.documentTitlePartialreturns empty partials, but the declaredpandoc/title-block.html(format-html.ts#L631-L642) still stages, and the template still calls$title-block.html()$. Sotitle-block-style: nonerenders the plain Pandoc title block — title, subtitle, and date included.I'm leaving this issue open for the duplicate
title-block-headerbug, which can be reproduced without a user partial (although it relies on the slightly unusual behavior oftitle-block-style: none).Repro with no user partial, on Quarto 1.10.18:
_quarto.yml:index.qmd:The rendered page contains two elements with the same id:
The mechanism is
canonicalizeTitlePostprocessor(format-html-title.ts#L186-L241), registered only for website projects (website.ts#L254). When the page has noheader.quarto-title-block, it creates a second<header id="title-block-header" class="quarto-title-block">and moves the first<h1>into it. The subtitle and date stay behind in the original header. Any title block without thequarto-title-blockclass triggers this — a custom partial based onpandoc/title-block.html, or plaintitle-block-style: none.The same document renders correctly as a standalone HTML document (one header, plain Pandoc markup), since the postprocessor does not run outside websites.