Skip to content

Commit 95e3900

Browse files
authored
Merge pull request #126 from sdkman/fix-trailing-slash-2
Fix trailing slash config
2 parents cd7d6c4 + 1e5f87a commit 95e3900

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docusaurus.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const config: Config = {
1313
// For GitHub pages deployment, it is often '/<projectName>/'
1414
baseUrl: '/',
1515

16-
trailingSlash: false,
16+
trailingSlash: true,
1717

1818
// GitHub pages deployment config.
1919
// If you aren't using GitHub pages, you don't need these.

src/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export function getNameFromPath(pathname: string, baseUrl: string): string {
55
: pathname.replace(new RegExp(`^${baseUrl}`), '/');
66
const pathParts = normalPathName.split('/');
77

8-
return pathParts.slice(-1)[0];
8+
return pathParts.filter((path) => !!path.length).slice(-1)[0];
99
}

0 commit comments

Comments
 (0)