Default and grid listings show categories and reading time that Quarto 1 leaves out

オープン 初心者向け
#1,031 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
77/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
html, rust, yaml
領域
backend, web-dev

調査の方向性

crates/quarto-core/src/project/listing/config.rs (996~1026行) のデフォルトフィールドのロジックと、crates/quarto-core/src/project/listing/binding.rs (92~110行) でフィールドがどのように保持されるかを確認し、リンク先の website-listing-read.ts の各セクションにある Quarto 1 のデフォルトと比較します。issue の最小限の listing と grep コマンドで再現します。デフォルトの listing が記載された動作と一致すれば完了です。カテゴリと読了時間は、明示的に要求された場合にのみ表示されます。

索引モデルが issue の本文から書いたものです。

説明

Bug description

A default or grid listing without a fields: key shows two extra parts in q2.
Each item gets a category chip row and a "1 min read" line.
Quarto 1 draws neither for the same input, so a site that moves to q2 gets a different card layout without changing any listing option.

The q2 design note means to copy the Quarto 1 defaults from hydrateListing, but its table lists eleven fields, adding categories, filename, file-modified and reading-time:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/claude-notes/plans/2026-05-06-listings-L2-data-model.md?plain=1#L398-L407

The code follows that table:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/crates/quarto-core/src/project/listing/config.rs#L996-L1026

Quarto 1 has six fields for default and five for grid:

https://github.com/quarto-dev/quarto-cli/blob/b9245f90c951fa2517f1a3c99920dc80fe90955f/src/project/types/website/listing/website-listing-read.ts#L138-L152

It adds categories only when the listing sets categories::

https://github.com/quarto-dev/quarto-cli/blob/b9245f90c951fa2517f1a3c99920dc80fe90955f/src/project/types/website/listing/website-listing-read.ts#L646-L654

A defaulted field is kept in q2 when at least one item carries it.
Every document has a reading time, so the line always appears, and any item with categories gets its chips:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/crates/quarto-core/src/project/listing/binding.rs#L92-L110

Steps to reproduce

_quarto.yml:

project:
  type: website

index.qmd:

---
listing:
  contents: posts
---

posts/a.qmd:

---
title: A
categories: [alpha]
---

Text.

With q2:

q2 render
grep -c 'listing-reading-time"' _site/index.html
grep -c 'class="listing-category"' _site/index.html

With Quarto 1:

quarto render
grep -c 'listing-reading-time"' _site/index.html
grep -c 'class="listing-category"' _site/index.html
Actual behavior

q2 prints a count of 2 for the reading time and 1 for the category, with this markup:

<div class="listing-categories"><div class="listing-category" onclick="window.quartoListingCategory('YWxwaGE='); return false;">alpha</div></div>
<p><span class="listing-reading-time">1 min read</span></p>

Quarto 1 prints 0 for both.

Expected behavior

The item shows the title and description, as in Quarto 1.
Categories appear when the author sets categories: true on the listing or lists categories in fields:.
Reading time appears only when fields: names it.

Your environment
  • q2: Q2 (quarto 2) 0.40.0-nightly.20261101 (nightly built from a2a1cb9).
  • Quarto 1 for comparison: 1.12.0 (pre-release).
  • OS: macOS 27.2 (arm64).
  • Terminal, no IDE.
主要言語
Rust
スター
293
フォーク
20
平均マージ
5時間 38分
マージ済み PR(30日)
199

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/q2 のほかの issue

quarto-dev/q2 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。