Skip to content

Commit

Permalink
fixing doc names
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Nov 30, 2024
1 parent a1180d5 commit bc29a62
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docc.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit bc29a62

Please sign in to comment.