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 = ({
2727
2828 // infer page route path from file path
2929 // foo/bar.md -> /foo/bar.html
30- const pathInferred = ensureLeadingSlash ( inferRoutePath ( filePathRelative ) )
30+ const pathInferred = inferRoutePath ( ensureLeadingSlash ( filePathRelative ) )
3131
3232 // resolve page locale path
3333 const pathLocale = resolveLocalePath ( app . siteData . locales , pathInferred )
Original file line number Diff line number Diff line change @@ -21,27 +21,55 @@ const appWithoutLocales = createBaseApp({
2121} )
2222
2323const TEST_CASES : [ string , ReturnType < typeof inferPagePath > ] [ ] = [
24+ [
25+ 'README.md' ,
26+ {
27+ pathInferred : '/' ,
28+ pathLocale : '/' ,
29+ } ,
30+ ] ,
2431 [
2532 'foo.md' ,
2633 {
2734 pathInferred : '/foo.html' ,
2835 pathLocale : '/' ,
2936 } ,
3037 ] ,
38+ [
39+ 'en/README.md' ,
40+ {
41+ pathInferred : '/en/' ,
42+ pathLocale : '/en/' ,
43+ } ,
44+ ] ,
3145 [
3246 'en/foo.md' ,
3347 {
3448 pathInferred : '/en/foo.html' ,
3549 pathLocale : '/en/' ,
3650 } ,
3751 ] ,
52+ [
53+ 'zh/README.md' ,
54+ {
55+ pathInferred : '/zh/' ,
56+ pathLocale : '/zh/' ,
57+ } ,
58+ ] ,
3859 [
3960 'zh/foo.md' ,
4061 {
4162 pathInferred : '/zh/foo.html' ,
4263 pathLocale : '/zh/' ,
4364 } ,
4465 ] ,
66+ [
67+ '中文/README.md' ,
68+ {
69+ pathInferred : '/中文/' ,
70+ pathLocale : '/中文/' ,
71+ } ,
72+ ] ,
4573 [
4674 '中文/foo.md' ,
4775 {
You can’t perform that action at this time.
0 commit comments