Skip to content

Commit ad2045f

Browse files
dirname with dot (#197)
1 parent dbb6f6e commit ad2045f

File tree

1 file changed

+2
-1
lines changed
  • packages/astro-theme/lib

1 file changed

+2
-1
lines changed

packages/astro-theme/lib/nav.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ export function idToTitle(id: string): string {
235235

236236
// Strip extension
237237
const dotIndex = filename.lastIndexOf(".");
238-
if (dotIndex !== -1) {
238+
const supportedExt = [".md", ".mdx"]; //to include dir names with dots
239+
if (dotIndex !== -1 && supportedExt.includes(filename.slice(dotIndex, -1))) {
239240
filename = filename.slice(0, dotIndex);
240241
}
241242

0 commit comments

Comments
 (0)