style: auto-format page navigation

This commit is contained in:
Jean-Philippe Sirois
2020-10-01 16:43:48 -04:00
parent acb4f06843
commit aa623ae965
2 changed files with 13 additions and 14 deletions
+11 -8
View File
@@ -33,15 +33,18 @@ const ResourcePage: FC<any> = ({ data }) => {
toc.length
)
const pages = sortWith([
descend((f: any) => {
if (f.node.relativePath.includes("intro")) {
return 1;
}
const pages = sortWith(
[
descend((f: any) => {
if (f.node.relativePath.includes("intro")) {
return 1
}
return -1;
})
], data.allFile.edges)
return -1
}),
],
data.allFile.edges
)
const currentIndex = pages.findIndex(
(x: any) => x.node.relativePath === relativePath
)