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
Just ran into an issue related to #11618 and #12980 and #11596 while updating some course websites, but I think the problem is different enough to warrant a separate issue.
Sometime around October 2024 with #11224, h1 title canonicalization (i.e. wrapping page titles in <header><h1>blah</h1></header>) was introduced, and it was a little too overeager when using a custom template. That was fixed with #11596, but issues remain when using template partials (rather than full templates) inside Quarto websites.
Steps to reproduce
With this index.qmd:
---
title: "I am a title"
format:
html:
template-partials:
- title-block.html
---
Here's some text.
and this _quarto.yml:
project:
type: website
website:
title: "A neat website"
and this title-block.html template partial:
<div class="meta">
$if(title)$
<h1>$title$</h1>
$endif$
</div>
Actual behavior
Currently (using Quarto 1.8.20, but it's been happening since Quarto 1.6ish), that content area renders like this:
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block"><h1 class="title display-7">I am a title</h1></header>
<div class="meta">
</div>
<p>Here’s some text.</p>
</main>
with an empty .meta div and the canonicalized h1 by itself at the very beginning.
Expected behavior
Previously with Quarto 1.5, it would render to something like this—well, not exactly this; I don't have 1.5 installed anywhere, but the main point is that the h1 would appear inside the .meta div as defined in the template):
<div class="meta">
<h1 class="title display-7">I am a title</h1>
</div>
<p>Here’s some text.</p>
You can see the changed behavior IRL by comparing the home page here from fall 2024 with here from fall 2025. That area with the page/course title and the hex logo uses a custom title-block.html template partial (here) to put the title in a bootstrap grid like this (grossly oversimplified):
<div class="grid">
<div class="g-col-6">
$if(title)$<h1 class="title">$title$</h1>$endif$
</div>
<div class="g-col-6">
HEX LOGO
</div>
</div>
But since Quarto 1.6, that title now renders outside of that whole .grid class, like this:
<header><h1>TITLE GOES HERE NOW</h1></header>
<div class="grid">
<div class="g-col-6">
<!-- Nothing is here! -->
</div>
<div class="g-col-6">
HEX LOGO
</div>
</div>
Your environment
- IDE: Positron 2025.07.0 (Universal) build 204
- OS: macOS Sequoia 15.6
Quarto check output
quarto checkQuarto 1.8.20
[✓] 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.3.1: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.8.20
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 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 R installation...........OK
Version: 4.5.0
Path: /Library/Frameworks/R.framework/Versions/4.5-arm64/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.29
[✓] Checking Knitr engine render......OK
Activity
andrewheiss commentedon Aug 20, 2025
This might be a separate issue, but I'm pretty sure it's a symptom of the same phenomenon since it's directly related to template partials and the canonicalized h1
Weird things also happen when using the
code-toolsbutton. With thisindex.qmd(and with the same_quarto.ymlandtitle-block.htmlfrom above):…the code tools button no longer appears on the same line as the title and instead appears above:
The code tools button is placed immediately after the canonicalized
<header>element, but that<h1></h1>element is actually empty(!) and the title appears in the.metadiv as expected (which is WEIRD!):The code tools button appears as expected when not using the custom template partial:
For an IRL example, compare this from fall 2024 with this from fall 2025, using this template partial
Add a border to the site title since it won't go in the bootstrap grid?
andrewheiss commentedon Jan 4, 2026
K, so this is actually no longer an issue (discovered in a separate but related issue at #13841 (comment)). The main problem is that I wasn't using all the special Quarto-specific elements in the custom title-block template partial—I was using the base pandoc title-block partial at
src/resources/formats/html/pandoc/title-block.htmlinstead of the Quarto template one atsrc/resources/formats/html/templates/title-block.html.With a barebones template partial, titles are canonicalized differently and the code-tools button is placed incorrectly because the resulting content is missing a lot of the Quarto-specific CSS scaffolding, etc. If adjustments are made based on the htm/templates version of the title-block.html partial, which includes all the expected CSS IDs and classes + the pandoc
$title-metadata.html()$template, things work as expected and everything is placed correctly.