chore: Routing Refactor (#3)

* scrape with 1:1 mapping to origin repo

* exclude .md extension from file path in URLs inside MDs

* removed legacy static files

* remove image path manipulation

* move scrapper to new folder

* sidebar custom ordering implemented
This commit is contained in:
Filip Pajic
2024-04-25 09:29:22 +02:00
committed by GitHub
parent ac48b3aa6f
commit 32f0947064
14 changed files with 178 additions and 20 deletions

View File

@@ -0,0 +1,28 @@
const { compose } = require("./utils");
const {
positionDefaultReadmeToTop,
removeRFCNumberedDirectories,
separateFoldersAndFilesOrder,
orderAlphabeticallyAndByNumber
} = require("./modifiers")
async function sidebarItemsGenerator({defaultSidebarItemsGenerator, ...args}) {
const defaultSidebarItems = await defaultSidebarItemsGenerator(args);
/*
We'll have multiple O(N) passes through the items depending on the reducer implementation,
but we'll sacrifice very small performance for sake of easier maintainability
*/
const sidebarModifier = compose(
positionDefaultReadmeToTop,
separateFoldersAndFilesOrder,
removeRFCNumberedDirectories,
orderAlphabeticallyAndByNumber
)
return sidebarModifier(defaultSidebarItems)
}
module.exports = {
sidebarItemsGenerator
}