diff --git a/docc.data.ts b/docc.data.ts index 256a9ec..a16bd38 100644 --- a/docc.data.ts +++ b/docc.data.ts @@ -5,12 +5,17 @@ const baseURL = ? 'https://docs.getbushel.app' : 'http://localhost:3000' -const modules = fs.readdirSync("public/swift-docc/documentation").filter( (name) => { - return name.toLocaleLowerCase().startsWith("bushel") -}).map((name) => { +const modules = fs.readdirSync("public/swift-docc/data/documentation").filter( (name) => { const lowerCase = name.toLocaleLowerCase() + return lowerCase.startsWith("bushel") && lowerCase.endsWith("json") +}).map((name) => { + + const json = fs.readFileSync("public/swift-docc/data/documentation/" + name) + const data = JSON.parse(json) + const text = data.metadata.title + const lowerCase = name.split(".")[0].toLocaleLowerCase() return { - text: name, + text: text, link: `${baseURL}/swift-docc/documentation/${lowerCase}/`, target: "_self" }