Skip to content

Commit 781fcad

Browse files
committed
Ugly workaround for pages named with unicode characters. Untested (taken from other version).
1 parent 4a5aa48 commit 781fcad

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

lib/common/utils.js

+22-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,23 @@ function cleanChildrenRoutes(routes, isChild = false) {
254254
return routes
255255
}
256256

257-
exports.createRoutes = function createRoutes(files, srcDir, pagesDir) {
257+
exports.createRoutes = function createRoutes(files, srcDir) {
258+
259+
const cloneObject = function(obj) {
260+
var newObj = {};
261+
262+
for (var prop in obj) {
263+
if (typeof obj[prop] == 'object') {
264+
newObj[prop] = cloneObject(obj[prop]);
265+
} else {
266+
newObj[prop] = obj[prop];
267+
}
268+
}
269+
270+
return newObj;
271+
}
272+
273+
258274
let routes = []
259275
files.forEach(file => {
260276
let keys = file
@@ -287,8 +303,12 @@ exports.createRoutes = function createRoutes(files, srcDir, pagesDir) {
287303
}
288304
}
289305
})
306+
const route2 = cloneObject(route);
307+
route2.path = encodeURI(route2.path);
308+
290309
// Order Routes path
291-
parent.push(route)
310+
parent.push(route);
311+
parent.push(route2);
292312
parent.sort((a, b) => {
293313
if (!a.path.length) {
294314
return -1

0 commit comments

Comments
 (0)