Skip to content

Commit

Permalink
brand,html - forward logo to navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
cscheid committed Oct 7, 2024
1 parent ba6730f commit 572c90b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/project/types/website/website-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ??
Expand All @@ -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) {
Expand Down

0 comments on commit 572c90b

Please sign in to comment.