Add group age

This commit is contained in:
Kamran Ahmed
2021-12-04 12:21:06 +01:00
parent f500d49275
commit 3b47cd3542
31 changed files with 186 additions and 28 deletions

View File

@ -167,11 +167,13 @@ function createDirTree(
const childrenDirNames = Object.keys(dirTree);
const hasChildren = childrenDirNames.length !== 0;
// @todo write test for this, yolo for now
const groupName = parentDir
.replace(roadmapContentDirPath, '') // Remove base dir path
.replace(/(^\/)|(\/$)/g, '') // Remove trailing slashes
.replace(/(^\d+?-)/g, '') // Remove sorting information
.replace('/', ':'); // Replace slashes with `:`
.replaceAll('/', ':') // Replace slashes with `:`
.replace(/:\d+-/, ':');
const sortOrder = sortOrders[groupName] || '';