A dashboard `logo` without `logo-alt` gives an unlabelled link and a `Q-10-2` warning about template variables

オープン
#1,134 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

Start in crates/quarto-core/src/dashboard/navbar.rs where logo variants receive alt, then trace the template access in crates/quarto-core/src/template.rs and the dashboard title or brand metadata available there. Reproduce with the supplied dashboard and compare q2’s output with Quarto 1. Done when the logo link has an accessible name where possible and missing names produce one actionable warning instead of two undefined-variable warnings.

索引モデルが issue の本文から書いたものです。

説明

Bug description

The dashboard from #1131 sets a logo and no logo-alt, and each q2 render ends with two template warnings about it.
The warnings point at a real problem, but they do not say what it is.

Without logo-alt, both q2 and Quarto 1 write the logo as the only content of a link, with alt="".
An empty alt marks the image as decorative, so the link has no accessible name, and a screen reader announces it as an unlabelled link.

q2 notices that alt is missing, but reports it as a template detail.
The navbar code adds an alt key to each logo variant only when logo-alt is set:

https://github.com/quarto-dev/q2/blob/8f17e950d26c68daae6e794c5fa513a96c0dae68/crates/quarto-core/src/dashboard/navbar.rs#L218-L225

The template then reads that key for both images, and the missing key becomes an undefined-variable warning:

https://github.com/quarto-dev/q2/blob/8f17e950d26c68daae6e794c5fa513a96c0dae68/crates/quarto-core/src/template.rs#L541-L542

Steps to reproduce

Put any logo.svg next to index.qmd:

---
title: Hello
format:
  dashboard:
    logo: logo.svg
---

## Row

Hello.
q2 render index.qmd
quarto render index.qmd
grep -o '<a href="#"><img[^>]*navbar-logo[^>]*></a>' index.html
Actual behavior

q2 prints:

Warning [Q-10-2]: Undefined variable: rendered.dashboard.logo.light.alt
Warning [Q-10-2]: Undefined variable: rendered.dashboard.logo.dark.alt
2 warnings

Quarto 1 prints nothing.
Both write the same links, with no accessible name:

<a href="#"><img src="logo.svg" alt="" class="navbar-logo light-content d-inline-block"></a>
<a href="#"><img src="logo.svg" alt="" class="navbar-logo dark-content d-inline-block"></a>
Expected behavior

The logo link has an accessible name even without logo-alt, for example from the document title or from the brand's meta.name.
When no name can be found, a single warning tells the author to set logo-alt, in place of two warnings about rendered.dashboard.logo.*.alt.

Your environment
  • q2: q2 (quarto 2) 0.43.0-nightly.20261109 (nightly built from 8f17e95), and q2 v0.42.0.
  • Quarto 1 for comparison: development build of quarto-dev/quarto-cli@fa74261.
  • OS: macOS 27.2 (arm64).
  • Terminal, no IDE.
主要言語
Rust
スター
302
フォーク
22
平均マージ
5時間 8分
マージ済み PR(30日)
220

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/q2 のほかの issue

quarto-dev/q2 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。