Skip to content

Commit

Permalink
fix sidebar issue and ensure that the navTitle is used for director…
Browse files Browse the repository at this point in the history
…ies with an index file
  • Loading branch information
noxify committed Feb 1, 2025
1 parent 1fc4849 commit 4235089
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ async function buildTreeNavigation(entry: EntryType): Promise<TreeItem | null> {
return null
}
if (isDirectory(entry)) {
const file = await getFileContent(entry)
let frontmatter = null
if (file) {
frontmatter = await file.getExportValue("frontmatter")
}
return {
title: entry.getTitle(),
title: frontmatter?.navTitle ?? entry.getTitle(),
path: `/docs${entry.getPath()}`,
isFile: isFile(entry),
slug: entry.getPathSegments(),
Expand Down

0 comments on commit 4235089

Please sign in to comment.