Categories in a post's title block are not linked to the listing

Aperta
#1,256 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
57/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
frontend

Direzione di ricerca

Start by tracing how q2 renders listing pages and the .quarto-category markup, then compare the behavior described in src/resources/formats/html/quarto.js and the listings plan at claude-notes/plans/2026-05-05-listings-epic.md. Check how q2 knows which listings contain a page and where category links can be emitted at render time. Done means title-block categories link to a containing listing with the category filter, including the described listing selection behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In Quarto 1, the categories shown in a post's title block link back to the listing that contains the post, filtered on that category (#category=R). quarto.js does it at load time: it fetches listings.json, keeps the listings whose items include the current page, picks one (the nearest parent listing, else the listing the reader came from, else the first one) and wraps each .quarto-category in a link.

q2 renders the same markup (<div class="quarto-category">R</div>) but emits neither listings.json nor the script, so the categories are plain text. The listing side already works: with categories: true, the category sidebar filters the items, and index.html#category=R filters on load.

The listings epic notes defer listings.json until search lands (claude-notes/plans/2026-05-05-listings-epic.md). This issue is about the user-visible part: linking title-block categories to their listing.

Reproduction:

# _quarto.yml
project:
  type: website
# index.qmd
---
title: Blog
listing:
  contents: posts
  categories: true
---
# posts/a/index.qmd
---
title: A post
categories: [R]
---

q2 render, open _site/posts/a/index.html: the "R" category is not a link. In Quarto 1 it links to the root listing (/index.html#category=R).

We could write the links at render time instead, since q2 knows which listings include a page: no listings.json, no fetch. The nearest parent listing, then the first one, can be chosen the same way as Quarto 1. Only the referrer case needs the browser.

Workaround used on cderv.dev: a small include-after-body script in the theme extension that links each category to the root index.html (cderv/quarto-ghostwriter#7).

Lingua principale
Rust
Stelle
316
Fork
23
Merge medio
11h 49m
PR unite (30g)
245

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quarto-dev/q2

Tutte le issue di quarto-dev/q2

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.