Skip to content

Commit 212aa84

Browse files
committed
fix: fix
1 parent 3533160 commit 212aa84

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/shared/src/utils/inferRoutePath.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Infer route path according to the given (markdown file) path
33
*/
4-
export const inferRoutePath = (path: string): string => {
4+
export const inferRoutePath = (path: string, cleanUrl = false): string => {
55
// if the pathname is empty or ends with `/`, return as is
66
if (!path || path.endsWith('/')) return path
77

@@ -22,5 +22,9 @@ export const inferRoutePath = (path: string): string => {
2222
routePath = routePath.substring(0, routePath.length - 10)
2323
}
2424

25+
if (routePath.endsWith('.html') && cleanUrl) {
26+
routePath = routePath.substring(0, routePath.length - 5)
27+
}
28+
2529
return routePath
2630
}

0 commit comments

Comments
 (0)