diff --git a/src/components/Site/Site.jsx b/src/components/Site/Site.jsx index 600fe112cc24..d1221e05bea6 100644 --- a/src/components/Site/Site.jsx +++ b/src/components/Site/Site.jsx @@ -43,18 +43,17 @@ const Site = ({ .map((section) => ({ title: section.path.title, url: section.url, - pages: section.pages.map(page => ({ - file: page.file, - title: page.file.title, - url: page.url - })).sort(({ file: { attributes: a }}, { file: { attributes: b }}) => { + pages: section.pages.slice().sort(({ file: { attributes: a }}, { file: { attributes: b }}) => { let group1 = a.group.toLowerCase(); let group2 = b.group.toLowerCase(); if (group1 < group2) return -1; if (group1 > group2) return 1; return a.sort - b.sort; - }) + }).map(page => ({ + title: page.file.title, + url: page.url + })) })) } />