Skip to content

Commit

Permalink
dirname with dot (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielaReyna authored Jan 9, 2025
1 parent dbb6f6e commit ad2045f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/astro-theme/lib/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ export function idToTitle(id: string): string {

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

Expand Down

0 comments on commit ad2045f

Please sign in to comment.