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

未关闭
#15,430 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
backend

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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
主要语言
JavaScript
星标
6.2k
派生
492
平均合并
13 小时 51 分钟
30 天内合并 PR
82

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quarto-dev/quarto-cli 的其他 Issue

查看 quarto-dev/quarto-cli 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。