File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export const inferPagePath = ({
27
27
28
28
// infer page route path from file path
29
29
// foo/bar.md -> /foo/bar.html
30
- const pathInferred = ensureLeadingSlash ( inferRoutePath ( filePathRelative ) )
30
+ const pathInferred = inferRoutePath ( ensureLeadingSlash ( filePathRelative ) )
31
31
32
32
// resolve page locale path
33
33
const pathLocale = resolveLocalePath ( app . siteData . locales , pathInferred )
Original file line number Diff line number Diff line change @@ -21,27 +21,55 @@ const appWithoutLocales = createBaseApp({
21
21
} )
22
22
23
23
const TEST_CASES : [ string , ReturnType < typeof inferPagePath > ] [ ] = [
24
+ [
25
+ 'README.md' ,
26
+ {
27
+ pathInferred : '/' ,
28
+ pathLocale : '/' ,
29
+ } ,
30
+ ] ,
24
31
[
25
32
'foo.md' ,
26
33
{
27
34
pathInferred : '/foo.html' ,
28
35
pathLocale : '/' ,
29
36
} ,
30
37
] ,
38
+ [
39
+ 'en/README.md' ,
40
+ {
41
+ pathInferred : '/en/' ,
42
+ pathLocale : '/en/' ,
43
+ } ,
44
+ ] ,
31
45
[
32
46
'en/foo.md' ,
33
47
{
34
48
pathInferred : '/en/foo.html' ,
35
49
pathLocale : '/en/' ,
36
50
} ,
37
51
] ,
52
+ [
53
+ 'zh/README.md' ,
54
+ {
55
+ pathInferred : '/zh/' ,
56
+ pathLocale : '/zh/' ,
57
+ } ,
58
+ ] ,
38
59
[
39
60
'zh/foo.md' ,
40
61
{
41
62
pathInferred : '/zh/foo.html' ,
42
63
pathLocale : '/zh/' ,
43
64
} ,
44
65
] ,
66
+ [
67
+ '中文/README.md' ,
68
+ {
69
+ pathInferred : '/中文/' ,
70
+ pathLocale : '/中文/' ,
71
+ } ,
72
+ ] ,
45
73
[
46
74
'中文/foo.md' ,
47
75
{
You can’t perform that action at this time.
0 commit comments