mirror of
https://github.com/vacp2p/rfc.vac.dev.git
synced 2026-01-06 22:53:50 -05:00
* 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
28 lines
807 B
JavaScript
28 lines
807 B
JavaScript
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
|
|
} |