A template partial is rejected when the page has `title-block-style: none`

Ouverte
#15,430 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
javascript
Domaine
backend

Piste de recherche

Start in src/command/render/pandoc.ts, where the issue locates the partial validation, and trace how the accepted partial list changes with title-block-style. Reproduce with the supplied Quarto document, then check the render behavior for title-block-style: none and the default style. Done means the render succeeds when the declared partial is unused under that style, while preserving use of the partial where supported.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug html templates
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

template-partials accepts a partial only when its name is in the list of partials of the page.
That list depends on title-block-style.
With the default style, title-metadata.html is in the list.
With title-block-style: none, it is not, so the render fails, although nothing else is wrong.

This hits extensions.
An extension that ships title-metadata.html in the template-partials of its html format breaks every page that turns the title block off.
There is no way to make the partial optional.

Related: #14793 (validation does not catch unused partials) and #14794 (the docs do not list the title block partials).
Here the validation is too strict instead: it refuses a partial that Quarto accepts under another title-block-style.

Steps to reproduce
````qmd
---
title: "Title"
title-block-style: none
format:
  html:
    template-partials:
      - title-metadata.html
---

Text.
````

title-metadata.html can hold any HTML, for example <p class="custom-meta">custom</p>.
Without the title-block-style: none line, the same document renders and the partial is used.

Actual behavior
ERROR: The format 'html' only supports the following partials:
metadata.html
title-block.html
toc.html
styles.html

Please provide one or more of these partials.

The check is in src/command/render/pandoc.ts: it needs at least one user partial whose name is in the partials of the format, and for this style title-metadata.html is not among them.

Expected behavior

The render succeeds and ignores the partial, as it does for a partial that the template never calls (#14793).

Your environment
  • IDE: none, command line
  • OS: macOS 27.2.1
Quarto check output
Quarto 99.9.9
Pandoc version 3.13.0: OK
Dart Sass version 1.107.1: OK
Deno version 2.9.8: OK
Typst version 0.15.1: OK
Version: 99.9.9
commit: 83432c028f6c07167c23f948da7067b37fe8a18b
Langage dominant
JavaScript
Étoiles
6.2k
Forks
492
Merge moyen
13 h 51 min
PR mergées (30 j)
82

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de quarto-dev/quarto-cli

Toutes les issues de quarto-dev/quarto-cli

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.