Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions news/changelog-1.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ All changes included in 1.10:

- ([#14354](https://github.com/quarto-dev/quarto-cli/pull/14354)): Fix trailing whitespace after author name on title slide when ORCID is not set. (author: @jnkatz)

## Projects

### Websites

- ([#13565](https://github.com/quarto-dev/quarto-cli/issues/13565), [#14353](https://github.com/quarto-dev/quarto-cli/issues/14353)): Fix sidebar logo not appearing on secondary sidebars in multi-sidebar website layouts.

## Commands

### `quarto preview`
Expand Down
50 changes: 18 additions & 32 deletions src/project/types/website/website-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,40 +171,26 @@ export async function websiteNavigationConfig(project: ProjectContext) {
sidebars[0].tools = [];
}

let sideLogo = sidebars[0].logo;
if (sideLogo !== false) { // don't do anything logo processing when sidebar logo is opt-out
if (sideLogo && sidebars[0][kLogoAlt]) {
const alt = sidebars[0][kLogoAlt];
if (typeof sideLogo === "string") {
sideLogo = { path: sideLogo, alt };
for (let i = 0; i < sidebars.length; i++) {
const sb = sidebars[i];
// Secondary sidebars without explicit logo inherit from the first via propagation
if (i > 0 && sb.logo === undefined) continue;
let sideLogo = sb.logo;
if (sideLogo !== false) { // don't do anything logo processing when sidebar logo is opt-out
if (sideLogo && sb[kLogoAlt]) {
const alt = sb[kLogoAlt];
if (typeof sideLogo === "string") {
sideLogo = { path: sideLogo, alt };
}
}
// possible but absurd
// else if ("path" in sideLogo) {
// sideLogo = { ...sideLogo, alt };
// } else {
// sideLogo = {
// light: !sideLogo.light ? undefined : typeof sideLogo.light === "string"
// ? {
// path: sideLogo.light,
// alt,
// }
// : { ...sideLogo.light, alt },
// dark: !sideLogo.dark ? undefined : typeof sideLogo.dark === "string"
// ? {
// path: sideLogo.dark,
// alt,
// }
// : { ...sideLogo.dark, alt },
// };
// }
let logo = resolveLogo(projectBrand, sideLogo, [
"medium",
"small",
"large",
]);
logo = logoAddLeadingSlashes(logo, projectBrand, undefined);
sb.logo = logo;
}
let logo = resolveLogo(projectBrand, sideLogo, [
"medium",
"small",
"large",
]);
logo = logoAddLeadingSlashes(logo, projectBrand, undefined);
sidebars[0].logo = logo;
}

// convert contents: auto into items
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.quarto/
**/*.quarto_ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
color:
background:
light: "#fff"
dark: "#111"
foreground:
light: "#111"
dark: "#fff"
logo:
medium:
light: sun-face.png
dark: moon-face.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
project:
type: website
theme:
light: brand
dark: [brand, dark-fixups.scss]
website:
sidebar:
- title: "Group 1"
style: "docked"
contents:
- index.qmd

- title: "Group 2"
style: "docked"
contents:
- page.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*-- scss:rules --*/

nav.sidebar.sidebar-navigation:not(.rollup) {
background-color: #282b30;
}

nav.navbar {
background-color: rgba(13, 108, 251, 25%);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: "Group 1 Page"
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'img[class*="light-content"][src="./sun-face.png"]'
- 'img[class*="dark-content"][src="./moon-face.png"]'
- []
---

First sidebar with no explicit logo. Brand logo should be resolved for sidebar 1.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: "Group 2 Page"
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'img[class*="light-content"][src="./sun-face.png"]'
- 'img[class*="dark-content"][src="./moon-face.png"]'
- []
---

Second sidebar with no explicit logo. Brand logo should be inherited from sidebar 1.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.quarto/
**/*.quarto_ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
project:
type: website
output-dir: _site

render:
- index.qmd
- page.qmd
- page2.qmd

website:
title: "Issue 14353"
sidebar:
- title: "Group 1"
logo: /img/logo-a.png
contents:
- index.qmd

- title: "Group 2"
logo: /img/logo-b.png
contents:
- page.qmd

- title: "Group 3"
contents:
- page2.qmd

format:
html:
theme: cosmo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Group 1 Page"
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'a.sidebar-logo-link img[src$="logo-a.png"][class*="sidebar-logo"]'
- []
---

This page belongs to the first sidebar entry. Its logo (logo-a.png) should render.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Group 2 Page"
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'a.sidebar-logo-link img[src$="logo-b.png"][class*="sidebar-logo"]'
- []
---

This page belongs to the second sidebar entry. Its logo (logo-b.png) should render.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Group 3 Page"
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'a.sidebar-logo-link img[src$="logo-a.png"][class*="sidebar-logo"]'
- []
---

This page belongs to the third sidebar entry which has no explicit logo. It should inherit logo-a.png from the first sidebar.
Loading