Skip to content

Page titles not placed correctly when using custom template partials in websites #13247

@andrewheiss

Description

@andrewheiss

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 check
Quarto 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebsitesIssues creating websites

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions