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

Abierto Apto para principiantes
#1,031 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
77/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
html, rust, yaml
Área
backend, web-dev

Línea de trabajo

Empieza por la lógica de los campos predeterminados en crates/quarto-core/src/project/listing/config.rs (líneas 996–1026) y cómo se conservan los campos en crates/quarto-core/src/project/listing/binding.rs (líneas 92–110); compara los valores predeterminados de Quarto 1 en las secciones enlazadas de website-listing-read.ts. Reprodúcelo con el listado mínimo del issue y los comandos grep. El trabajo estará terminado cuando el listado predeterminado coincida con el comportamiento descrito: las categorías y el tiempo de lectura aparecen solo cuando se solicitan explícitamente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Rust
Estrellas
293
Forks
20
Merge medio
5 h 38 min
PR fusionados (30 d)
199

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de quarto-dev/q2

Todos los issues de quarto-dev/q2

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.