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

Đang mở
#1,256 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
57/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
Rust
Star
316
Fork
23
Merge trung bình
11 giờ 49 phút
Pull request đã merge (30 ngày)
245

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quarto-dev/q2

Tất cả issue của quarto-dev/q2

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.