Navbar `logo-alt` is ignored when `logo` uses the `light`/`dark` form
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript, yaml
调研方向
阅读 src/project/types/website/website-shared.ts,查看 logo-alt 在 resolveLogo() 之前的处理方式,然后检查 src/resources/projects/website/templates/navbrand.ejs 以及附近有关浅色和深色 logo 渲染的测试。使用 issue 中的 YAML 配置复现问题,并检查生成的 navbar <img> 元素。完成标准是:两个变体在没有各自替代文本时都使用 logo-alt,同时保留明确指定的变体替代文本。
由索引模型根据 Issue 内容生成。
描述
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
website.navbar.logo-alt only takes effect when logo is a plain string.
With logo: {light, dark}, the value is dropped silently and both <img> elements render with alt="".
The navbar logo link then has no accessible name.
website-shared.ts wraps the string into { path, alt } before calling resolveLogo(), and does nothing for the object form.
The sidebar has the same shape for sidebar.logo-alt.
navbrand.ejs reads alt from each variant and falls back to an empty string.
Neither the schema nor the documentation says that logo-alt only applies to the string form.
This is different from #14660, which is about the default when no alt text is given at all.
Steps to reproduce
---
title: "Logo alt test"
---
Content.
_quarto.yml:
project:
type: website
website:
navbar:
logo:
light: light.svg
dark: dark.svg
logo-alt: "Site name"
quarto render
grep -o '<img[^>]*navbar-logo[^>]*>' _site/index.html
Actual behavior
<img src="./light.svg" alt="" class="navbar-logo light-content">
<img src="./dark.svg" alt="" class="navbar-logo dark-content">
With logo: light.svg and the same logo-alt, the output is alt="Site name".
With logo: {light: {path: light.svg, alt: "Light alt"}, dark: {path: dark.svg, alt: "Dark alt"}}, each variant gets its own alt.
Expected behavior
logo-alt is applied to both variants when they have no alt of their own.
If that is not wanted, rendering should warn that logo-alt is ignored for the light/dark form, and the schema description should say so.
Your environment
- IDE: none, terminal only
- OS: macOS (Darwin 27.0.0, Apple Silicon)
Quarto check output
Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.101.0: OK
Deno version 2.7.14: OK
Typst version 0.15.1: OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: 69592e5c1718d3e1b2f3d11e757d32e23a16af67
- 主要语言
- JavaScript
- 星标
- 6.1k
- 派生
- 478
- 平均合并
- 17 小时 26 分钟
- 30 天内合并 PR
- 126
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/quarto-cli 的其他 Issue
-
enhancement localization
难度 2/5 1-3 小时 新手友好度 65/100
quarto-dev/quarto-cli#15268 · 1 条评论 ·
维护者通常 1 天内回复
-
html maintenance
难度 2/5 1-3 小时 新手友好度 84/100
quarto-dev/quarto-cli#15261 ·
维护者通常 1 天内回复
-
enhancement websites
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/quarto-cli#15255 · 1 条评论 ·
维护者通常 1 天内回复
-
quarto.json.decode does not raise on invalid JSON, so pcall cannot catch it可能已有人在做 @sogav21 于 3 天前认领。 未关闭bug lua
难度 2/5 1-3 小时 新手友好度 84/100
quarto-dev/quarto-cli#15226 ·
维护者通常 1 天内回复
-
arrow-dark gives region markers a light band that fails contrast可能已有人在做 @vav7 于 2 天前认领。 未关闭accessibility bug themes
难度 1/5 1 小时以内 新手友好度 88/100
quarto-dev/quarto-cli#15222 ·
维护者通常 1 天内回复
查看 quarto-dev/quarto-cli 的全部 Issue
相似的 Issue
-
Handle HTTP errors when downloading release binaries可能已有人在做 @mugenkyou 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
neutralinojs/neutralinojs-cli#468 ·
维护者通常 1 天内回复
-
area:ci priority:p0 type:chore
难度 2/5 1-3 小时 新手友好度 70/100
lucacasanova/homedeck#2 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
terser/html-minifier-terser#242 ·
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 82/100
MustacheCase/zanadir#516 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
stylelint-scss/stylelint-config-standard-scss#297 · 1 条评论 ·