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

Open Beginner friendly
#1,031 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
77/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
html, rust, yaml
Domain
backend, web-dev

Research direction

Start with the default-field logic in crates/quarto-core/src/project/listing/config.rs (lines 996–1026) and how fields are retained in crates/quarto-core/src/project/listing/binding.rs (lines 92–110); compare Quarto 1's defaults in the linked website-listing-read.ts sections. Reproduce with the issue's minimal listing and grep commands. Done when the default listing matches the stated behavior: categories and reading time appear only when explicitly requested.

Written by the indexing model from the issue text.

Description

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.
Dominant language
Rust
Stars
302
Forks
22
Avg merge
5h 2m
Merged PRs (30d)
213

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/q2

All issues in quarto-dev/q2

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.