From 572c90b4e2f07b45f8ed93024d3574e4ebb588d4 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Mon, 7 Oct 2024 13:19:26 -0700 Subject: [PATCH] brand,html - forward logo to navbar --- src/project/types/website/website-shared.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/project/types/website/website-shared.ts b/src/project/types/website/website-shared.ts index 204a5faec2..6fff5d2196 100644 --- a/src/project/types/website/website-shared.ts +++ b/src/project/types/website/website-shared.ts @@ -166,7 +166,7 @@ export async function websiteNavigationConfig(project: ProjectContext) { const projectBrand = await project.resolveBrand(); if ( - projectBrand && sidebars && sidebars[0] && projectBrand.processedData.logo + projectBrand?.processedData.logo && sidebars?.[0] ) { if (sidebars[0].logo === undefined) { const logo = projectBrand.processedData.logo.medium ?? @@ -180,6 +180,19 @@ export async function websiteNavigationConfig(project: ProjectContext) { } } + if ( + projectBrand?.processedData && navbar + ) { + const logo = projectBrand.processedData.logo.small ?? + projectBrand.processedData.logo.medium ?? + projectBrand.processedData.logo.large; + if (typeof logo === "string") { + navbar.logo = logo; + } else if (typeof logo === "object") { + navbar.logo = logo.light; // TODO: This needs smarts to work on light+dark themes + } + } + // if there is more than one sidebar then propagate options from the // first sidebar to the others if (sidebars && sidebars.length > 1) {