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

Abierto
#1,134 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

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.

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

Descripción

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.
Lenguaje dominante
Rust
Estrellas
302
Forks
22
Merge medio
5 h 8 min
PR fusionados (30 d)
220

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.