Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/src/node/route/RouteService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const normalizeRoutePath = (
// remove the extension
.replace(new RegExp(`\\.(${extensions.join('|')})$`), '')
.replace(/\.html$/, '')
.replace(/\/readme$/i, '/')
.replace(/\/index$/, '/');

// restore the trail slash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The specific mapping rules are as follows:

| file path | route path |
| --------------- | ---------- |
| `README.md` | `/` |
| `index.md` | `/` |
| `/foo.md` | `/foo` |
| `/foo/bar.md` | `/foo/bar` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ docs

| 文件路径 | 路由路径 |
| --------------- | ---------- |
| `README.md` | `/` |
| `index.md` | `/` |
| `/foo.md` | `/foo` |
| `/foo/bar.md` | `/foo/bar` |
Expand Down