Skip to content
Merged
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
1 change: 1 addition & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ All changes included in 1.9:
- ([#13570](https://github.com/quarto-dev/quarto-cli/pull/13570)): Replace Twitter with Bluesky in default blog template and documentation examples. New blog projects now include Bluesky social links instead of Twitter.
- ([#13716](https://github.com/quarto-dev/quarto-cli/issues/13716)): Fix draft pages showing blank during preview when pre-render scripts are configured.
- ([#13847](https://github.com/quarto-dev/quarto-cli/pull/13847)): Open graph title with markdown is now processed correctly. (author: @mcanouil)
- ([#13910](https://github.com/quarto-dev/quarto-cli/issues/13910)): Add support for `logo: false` to disable sidebar and navbar logos when using `_brand.yml`. Works in website projects (`sidebar.logo: false`, `navbar.logo: false`) and book projects (`book.sidebar.logo: false`, `book.navbar.logo: false`).

### `book`

Expand Down
3 changes: 3 additions & 0 deletions src/core/brand/brand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ export function resolveLogo(
}
return logo;
};
if (spec === false) {
return undefined;
}
if (!spec) {
const lightLogo = findLogo("light", order);
const darkLogo = findLogo("dark", order);
Expand Down
2 changes: 1 addition & 1 deletion src/project/types/book/book-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export async function bookProjectConfig(
site[kSiteSidebar] = site[kSiteSidebar] || {};
const siteSidebar = site[kSiteSidebar] as Metadata;
siteSidebar[kSiteTitle] = siteSidebar[kSiteTitle] || book?.[kSiteTitle];
siteSidebar[kSidebarLogo] = siteSidebar[kSidebarLogo] || book?.[kSidebarLogo];
siteSidebar[kSidebarLogo] = siteSidebar[kSidebarLogo] ?? book?.[kSidebarLogo];
siteSidebar[kSidebarLogoHref] = siteSidebar[kSidebarLogoHref] ||
book?.[kSidebarLogoHref];
siteSidebar[kSidebarLogoAlt] = siteSidebar[kSidebarLogoAlt] ||
Expand Down
20 changes: 10 additions & 10 deletions src/project/types/website/website-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export async function websiteNavigationConfig(project: ProjectContext) {

// note no document-level customization of brand logo #11309
const projectBrand = await project.resolveBrand();
if (navbar) {
if (navbar && navbar.logo !== false) {
let navLogo = navbar.logo;
if (navbar[kLogoAlt]) {
if (typeof navLogo === "string") {
Expand Down Expand Up @@ -172,8 +172,8 @@ export async function websiteNavigationConfig(project: ProjectContext) {
}

let sideLogo = sidebars[0].logo;
if (sideLogo) {
if (sidebars[0][kLogoAlt]) {
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 };
Expand All @@ -198,14 +198,14 @@ export async function websiteNavigationConfig(project: ProjectContext) {
// };
// }
}
let logo = resolveLogo(projectBrand, sideLogo, [
"medium",
"small",
"large",
]);
logo = logoAddLeadingSlashes(logo, projectBrand, undefined);
sidebars[0].logo = logo;
}
let logo = resolveLogo(projectBrand, sideLogo, [
"medium",
"small",
"large",
]);
logo = logoAddLeadingSlashes(logo, projectBrand, undefined);
sidebars[0].logo = logo;

// convert contents: auto into items
for (const sb of sidebars) {
Expand Down
25 changes: 15 additions & 10 deletions src/resources/editor/tools/vs-code.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12174,8 +12174,13 @@ var require_yaml_intelligence_resources = __commonJS({
},
{
id: "logo-light-dark-specifier",
description: "Any of the ways a logo can be specified: string, object, or light/dark object of string or object\n",
description: "Any of the ways a logo can be specified: string, object, or light/dark object of string or object. Use `false` to explicitly disable the logo.\n",
anyOf: [
{
enum: [
false
]
},
{
ref: "logo-specifier"
},
Expand Down Expand Up @@ -22703,7 +22708,7 @@ var require_yaml_intelligence_resources = __commonJS({
"Alternative text for the logo, used for accessibility.",
"Path or brand.yml logo resource name.",
"Alternative text for the logo, used for accessibility.",
"Any of the ways a logo can be specified: string, object, or\nlight/dark object of string or object",
"Any of the ways a logo can be specified: string, object, or\nlight/dark object of string or object. Use <code>false</code> to\nexplicitly disable the logo.",
"Specification of a light logo",
"Specification of a dark logo",
"Any of the ways a logo can be specified: string, object, or\nlight/dark object of string or object",
Expand Down Expand Up @@ -23772,6 +23777,10 @@ var require_yaml_intelligence_resources = __commonJS({
short: "Shift heading levels by a positive or negative integer. For example,\nwith <code>shift-heading-level-by: -1</code>, level 2 headings become\nlevel 1 headings.",
long: "Shift heading levels by a positive or negative integer. For example,\nwith <code>shift-heading-level-by: -1</code>, level 2 headings become\nlevel 1 headings, and level 3 headings become level 2 headings. Headings\ncannot have a level less than 1, so a heading that would be shifted\nbelow level 1 becomes a regular paragraph. Exception: with a shift of\n-N, a level-N heading at the beginning of the document replaces the\nmetadata title."
},
{
short: "Schema to use for numbering pages, e.g.&nbsp;<code>1</code> or\n<code>i</code>, or <code>false</code> to omit page numbering.",
long: 'Schema to use for numbering pages, e.g.&nbsp;<code>1</code> or\n<code>i</code>, or <code>false</code> to omit page numbering.\nSee <a href="https://typst.app/docs/reference/model/numbering/">Typst\nNumbering</a> for additional information.'
},
{
short: "Sets the page numbering style and location for the document.",
long: 'Sets the page numbering style and location for the document using the\n<code>\\setuppagenumbering</code> command.\nSee <a href="https://wiki.contextgarden.net/Command/setuppagenumbering">ConTeXt\nPage Numbering</a> for additional information.'
Expand Down Expand Up @@ -24903,11 +24912,7 @@ var require_yaml_intelligence_resources = __commonJS({
"Disambiguating year suffix in author-date styles (e.g.&nbsp;\u201Ca\u201D in \u201CDoe,\n1999a\u201D).",
"Manuscript configuration",
"internal-schema-hack",
"List execution engines you want to give priority when determining\nwhich engine should render a notebook. If two engines have support for a\nnotebook, the one listed earlier will be chosen. Quarto\u2019s default order\nis \u2018knitr\u2019, \u2018jupyter\u2019, \u2018markdown\u2019, \u2018julia\u2019.",
{
short: "Schema to use for numbering pages, e.g.&nbsp;<code>1</code> or\n<code>i</code>, or <code>false</code> to omit page numbering.",
long: 'Schema to use for numbering pages, e.g.&nbsp;<code>1</code> or\n<code>i</code>, or <code>false</code> to omit page numbering.\nSee <a href="https://typst.app/docs/reference/model/numbering/">Typst\nNumbering</a> for additional information.'
}
"List execution engines you want to give priority when determining\nwhich engine should render a notebook. If two engines have support for a\nnotebook, the one listed earlier will be chosen. Quarto\u2019s default order\nis \u2018knitr\u2019, \u2018jupyter\u2019, \u2018markdown\u2019, \u2018julia\u2019."
],
"schema/external-schemas.yml": [
{
Expand Down Expand Up @@ -25136,12 +25141,12 @@ var require_yaml_intelligence_resources = __commonJS({
mermaid: "%%"
},
"handlers/mermaid/schema.yml": {
_internalId: 218561,
_internalId: 219129,
type: "object",
description: "be an object",
properties: {
"mermaid-format": {
_internalId: 218553,
_internalId: 219121,
type: "enum",
enum: [
"png",
Expand All @@ -25157,7 +25162,7 @@ var require_yaml_intelligence_resources = __commonJS({
exhaustiveCompletions: true
},
theme: {
_internalId: 218560,
_internalId: 219128,
type: "anyOf",
anyOf: [
{
Expand Down

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions src/resources/editor/tools/yaml/web-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 15 additions & 10 deletions src/resources/editor/tools/yaml/yaml-intelligence-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5146,8 +5146,13 @@
},
{
"id": "logo-light-dark-specifier",
"description": "Any of the ways a logo can be specified: string, object, or light/dark object of string or object\n",
"description": "Any of the ways a logo can be specified: string, object, or light/dark object of string or object. Use `false` to explicitly disable the logo.\n",
"anyOf": [
{
"enum": [
false
]
},
{
"ref": "logo-specifier"
},
Expand Down Expand Up @@ -15675,7 +15680,7 @@
"Alternative text for the logo, used for accessibility.",
"Path or brand.yml logo resource name.",
"Alternative text for the logo, used for accessibility.",
"Any of the ways a logo can be specified: string, object, or\nlight/dark object of string or object",
"Any of the ways a logo can be specified: string, object, or\nlight/dark object of string or object. Use <code>false</code> to\nexplicitly disable the logo.",
"Specification of a light logo",
"Specification of a dark logo",
"Any of the ways a logo can be specified: string, object, or\nlight/dark object of string or object",
Expand Down Expand Up @@ -16744,6 +16749,10 @@
"short": "Shift heading levels by a positive or negative integer. For example,\nwith <code>shift-heading-level-by: -1</code>, level 2 headings become\nlevel 1 headings.",
"long": "Shift heading levels by a positive or negative integer. For example,\nwith <code>shift-heading-level-by: -1</code>, level 2 headings become\nlevel 1 headings, and level 3 headings become level 2 headings. Headings\ncannot have a level less than 1, so a heading that would be shifted\nbelow level 1 becomes a regular paragraph. Exception: with a shift of\n-N, a level-N heading at the beginning of the document replaces the\nmetadata title."
},
{
"short": "Schema to use for numbering pages, e.g.&nbsp;<code>1</code> or\n<code>i</code>, or <code>false</code> to omit page numbering.",
"long": "Schema to use for numbering pages, e.g.&nbsp;<code>1</code> or\n<code>i</code>, or <code>false</code> to omit page numbering.\nSee <a href=\"https://typst.app/docs/reference/model/numbering/\">Typst\nNumbering</a> for additional information."
},
{
"short": "Sets the page numbering style and location for the document.",
"long": "Sets the page numbering style and location for the document using the\n<code>\\setuppagenumbering</code> command.\nSee <a href=\"https://wiki.contextgarden.net/Command/setuppagenumbering\">ConTeXt\nPage Numbering</a> for additional information."
Expand Down Expand Up @@ -17875,11 +17884,7 @@
"Disambiguating year suffix in author-date styles (e.g.&nbsp;“a” in “Doe,\n1999a”).",
"Manuscript configuration",
"internal-schema-hack",
"List execution engines you want to give priority when determining\nwhich engine should render a notebook. If two engines have support for a\nnotebook, the one listed earlier will be chosen. Quarto’s default order\nis ‘knitr’, ‘jupyter’, ‘markdown’, ‘julia’.",
{
"short": "Schema to use for numbering pages, e.g.&nbsp;<code>1</code> or\n<code>i</code>, or <code>false</code> to omit page numbering.",
"long": "Schema to use for numbering pages, e.g.&nbsp;<code>1</code> or\n<code>i</code>, or <code>false</code> to omit page numbering.\nSee <a href=\"https://typst.app/docs/reference/model/numbering/\">Typst\nNumbering</a> for additional information."
}
"List execution engines you want to give priority when determining\nwhich engine should render a notebook. If two engines have support for a\nnotebook, the one listed earlier will be chosen. Quarto’s default order\nis ‘knitr’, ‘jupyter’, ‘markdown’, ‘julia’."
],
"schema/external-schemas.yml": [
{
Expand Down Expand Up @@ -18108,12 +18113,12 @@
"mermaid": "%%"
},
"handlers/mermaid/schema.yml": {
"_internalId": 218561,
"_internalId": 219129,
"type": "object",
"description": "be an object",
"properties": {
"mermaid-format": {
"_internalId": 218553,
"_internalId": 219121,
"type": "enum",
"enum": [
"png",
Expand All @@ -18129,7 +18134,7 @@
"exhaustiveCompletions": true
},
"theme": {
"_internalId": 218560,
"_internalId": 219128,
"type": "anyOf",
"anyOf": [
{
Expand Down
3 changes: 2 additions & 1 deletion src/resources/schema/definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2722,8 +2722,9 @@
- id: logo-light-dark-specifier
description: >
Any of the ways a logo can be specified: string, object, or light/dark object of
string or object
string or object. Use `false` to explicitly disable the logo.
anyOf:
- enum: [false]
- ref: logo-specifier
- object:
closed: true
Expand Down
5 changes: 5 additions & 0 deletions src/resources/schema/json-schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -3359,6 +3359,11 @@
},
"LogoLightDarkSpecifier": {
"anyOf": [
{
"enum": [
false
]
},
{
"$ref": "#/$defs/LogoSpecifier"
},
Expand Down
4 changes: 2 additions & 2 deletions src/resources/types/schema-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1327,10 +1327,10 @@ export type LogoOptionsPathOptional = { alt?: string; path?: string };

export type LogoSpecifierPathOptional = string | LogoOptionsPathOptional;

export type LogoLightDarkSpecifier = LogoSpecifier | {
export type LogoLightDarkSpecifier = false | LogoSpecifier | {
dark?: LogoSpecifier;
light?: LogoSpecifier;
}; /* Any of the ways a logo can be specified: string, object, or light/dark object of string or object */
}; /* Any of the ways a logo can be specified: string, object, or light/dark object of string or object. Use `false` to explicitly disable the logo. */

export type LogoLightDarkSpecifierPathOptional = LogoSpecifierPathOptional | {
dark?: LogoSpecifierPathOptional;
Expand Down
1 change: 1 addition & 0 deletions src/resources/types/zod/schema-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ export const ZodLogoSpecifierPathOptional = z.union([
]);

export const ZodLogoLightDarkSpecifier = z.union([
z.literal(false),
z.lazy(() => ZodLogoSpecifier),
z.object({
light: z.lazy(() => ZodLogoSpecifier),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.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,18 @@
project:
type: book

book:
title: "Disable Both Logos Test"
chapters:
- index.qmd
- chapter.qmd
navbar:
logo: false
sidebar:
logo: false

format:
html:
theme:
light: [cosmo, brand]
dark: [darkly, brand]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: chapter
_quarto:
tests:
html:
ensureHtmlElements:
- []
- ['a.navbar-brand-logo', 'a.sidebar-logo-link']
---

Content
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: intro
_quarto:
tests:
html:
ensureHtmlElements:
- []
- ['a.navbar-brand-logo', 'a.sidebar-logo-link']
---

This test verifies that setting both `navbar.logo: false` and `sidebar.logo: false`
disables both logos in a book project even when `_brand.yml` defines a logo.
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,3 @@
/.quarto/

**/*.quarto_ipynb
Loading
Loading