Grid listing ignores image-height, so thumbnails render at full size
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、グリッド形式の一覧が image フィールドをどのようにレンダリングするか、また一覧の image-height オプションがそのレンダリング経路にどう渡されるかを追ってください。payload には実装ファイルやテストの名前は記載されていません。デフォルトの高さと明示的な高さの場合に生成されるサムネイルのマークアップを、Quarto 1 の例と比較してください。どちらの場合も、元画像を変更せずに期待される高さと card-img クラスが適用されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
In a grid listing, q2 ignores image-height. Quarto 1 gives each thumbnail an inline height (150px by default, or the image-height value) and the class card-img. q2 gives neither, so a large image shows at its full size. In our site, the thumbnails overlapped the next cards and made the page about 2,000px wide.
Versions
- q2 0.44.0-nightly.20261110
- Quarto 1.10.18 (expected output)
- macOS, arm64
Repro
_quarto.yml:
project:
type: website
render:
- "*.qmd"
- "posts/*.md"
default.qmd:
---
title: Default height
listing:
contents: "posts/*.md"
type: grid
fields: [image, title]
---
explicit.qmd:
---
title: Explicit height
listing:
contents: "posts/*.md"
type: grid
image-height: 100px
fields: [image, title]
---
posts/alpha.md, with posts/wide.png as any large image (we used 1600x1000):
---
title: "Alpha"
image: wide.png
---
Text.
Command:
q2 render
Expected (Quarto 1)
<!-- default.html -->
<img loading="lazy" src="./posts/wide.png" class="thumbnail-image card-img" style="height: 150px;">
<!-- explicit.html -->
<img loading="lazy" src="./posts/wide.png" class="thumbnail-image card-img" style="height: 100px;">
Actual (q2)
<!-- default.html -->
<img src="posts/wide.png" class="thumbnail-image" alt="" loading="lazy">
<!-- explicit.html -->
<img src="posts/wide.png" class="thumbnail-image" alt="" loading="lazy">
There is no warning.
Workaround
A stylesheet rule on the listing page:
.quarto-grid-item .card-img-top img.thumbnail-image {
height: 150px;
width: 100%;
object-fit: cover;
}
- 主要言語
- Rust
- スター
- 302
- フォーク
- 22
- 平均マージ
- 5時間 6分
- マージ済み PR(30日)
- 207
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/q2 のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
quarto-dev/q2#1135 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
quarto-dev/q2#1133 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
quarto-dev/q2#1103 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
quarto-dev/q2#1095 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
quarto-dev/q2#1031 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
backlog priority: low ui
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
storytold/vectorcraft#6445 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: cli kind:docs priority: P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
tursodatabase/libsql#2312 ·
メンテナーはふだん 11 日以内に返信
-
`NodeOwned::size_in_bytes` does not count the `ChildrenNodesOwned` heap allocation (since #216)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
paritytech/trie#251 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信