Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong object used in EJS to get logo-alt for sidebar #10254

Merged
merged 12 commits into from
Mar 5, 2025
1 change: 1 addition & 0 deletions news/changelog-1.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All changes included in 1.7:
## YAML validation

- ([#11654](https://github.com/quarto-dev/quarto-cli/issues/11654)): Allow `page-inset` as value in `column` key for code cells.
- ([#10251](https://github.com/quarto-dev/quarto-cli/issues/10251)): EJS template for website now uses proper object to get alt text for logo in sidebar.
- ([#12151](https://github.com/quarto-dev/quarto-cli/issues/12151)): Fix YAML validation in computations cell on Windows.
- ([#12151](https://github.com/quarto-dev/quarto-cli/pull/12151)): Basic YAML validation is now active in cell for document using Julia engine.

Expand Down
4 changes: 2 additions & 2 deletions src/resources/projects/website/templates/sidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="pt-lg-2 mt-2 <%= alignCss %> sidebar-header<%= sidebar.logo && sidebar.title ? ' sidebar-header-stacked' : '' %>">
<% if (sidebar.logo) { %>
<a href="<%- sidebar['logo-href'] || '/index.html' %>" class="sidebar-logo-link">
<img src="<%- sidebar.logo %>" alt="<%- navbar['logo-alt'] || '' %>" class="sidebar-logo py-0 d-lg-inline d-none"/>
<img src="<%- sidebar.logo %>" alt="<%- sidebar['logo-alt'] || '' %>" class="sidebar-logo py-0 d-lg-inline d-none"/>
</a>
<% } %>
<% if (needsTools && toolsLocation === "logo") { %>
Expand Down Expand Up @@ -92,4 +92,4 @@
<% } %>

</nav>
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" ></div>
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" ></div>
19 changes: 19 additions & 0 deletions tests/docs/smoke-all/2024/07/09/issue-10251/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
project:
type: website

website:
title: "issue-10251"
navbar:
logo: "https://quarto.org/quarto.png"
logo-alt: "this is the alt text that for the logo in the navbar"
left:
- href: index.qmd
text: Home
sidebar:
logo: "https://quarto.org/quarto.png"
logo-alt: "this is the alt text that for the logo in the sidebar"

format:
html:
theme: cosmo
toc: true
15 changes: 15 additions & 0 deletions tests/docs/smoke-all/2024/07/09/issue-10251/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "issue-10251"
_quarto:
tests:
html:
ensureFileRegexMatches:
- [
'<img src="https://quarto.org/quarto.png" alt="this is the alt text that for the logo in the sidebar" class="sidebar-logo py-0 d-lg-inline d-none">',
'<img src="https://quarto.org/quarto.png" alt="this is the alt text that for the logo in the navbar" class="navbar-logo">'
]
---

This is a Quarto website.

To learn more about Quarto websites visit <https://quarto.org/docs/websites>.
Loading