Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 9193c66

Browse files
committed
fix: only add .md extension when necessary
1 parent 3649a52 commit 9193c66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export const slugify = str => {
1717
export const getFilenameByPath = (sourcePath, path) => {
1818
sourcePath = sourcePath || ''
1919
sourcePath = sourcePath.replace(/\/$/, '')
20+
if (/\.md$/.test(path)) {
21+
return sourcePath + path
22+
}
2023
const filepath = /\/$/.test(path) ? `${path}README.md` : `${path}.md`
2124
return sourcePath + filepath
2225
}

0 commit comments

Comments
 (0)