Skip to content

Commit

Permalink
chore(docs): update vitepress sidebar lib
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Sep 17, 2024
1 parent 0869a85 commit 94584a0
Show file tree
Hide file tree
Showing 4 changed files with 423 additions and 165 deletions.
7 changes: 5 additions & 2 deletions website/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ const fixLinks = (sidebarMulti: SidebarMulti) => {

const fixTitles = (sidebarMulti: SidebarMulti) => {
return sidebarMultiVisitItems(sidebarMulti, (sidebarItem) => {
const [title, maybeHtml] = sidebarItem.text?.split('<') as [string, string | undefined]
if (sidebarItem.text) {
sidebarItem.text = capitalize(title.replaceAll(/-/g, ' ')) + (maybeHtml ? `<${maybeHtml}` : '')
sidebarItem.text = capitalize(sidebarItem.text.replaceAll(/-/g, ' '))
}
})
}
Expand All @@ -42,9 +41,13 @@ const sidebars = fixTitles(fixLinks(generateSidebar([
removePrefixAfterOrdering: true,
useTitleFromFrontmatter: true,
useTitleFromFileHeading: true,
hyphenToSpace: true,
capitalizeEachWords: true,
keepMarkdownSyntaxFromTitle: true,
},
{
hyphenToSpace: true,
capitalizeEachWords: true,
scanStartPath: 'content/examples',
resolvePath: '/examples/',
prefixSeparator: '_',
Expand Down
2 changes: 1 addition & 1 deletion website/content/guides/10_getting-started/20_generated.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Generated
title: Generated <span title="Requires generation" style="font-size:1.75em;line-height:0;">⩕</span>
---

# Getting Started <Badge text="generated client" />
Expand Down
6 changes: 3 additions & 3 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"vitepress": "^1.3.4"
},
"dependencies": {
"@shikijs/twoslash": "^1.17.6",
"@shikijs/vitepress-twoslash": "^1.17.6",
"@shikijs/twoslash": "^1.17.7",
"@shikijs/vitepress-twoslash": "^1.17.7",
"@tsconfig/node20": "^20.1.4",
"@tsconfig/strictest": "^2.0.5",
"es-toolkit": "^1.19.0",
Expand All @@ -21,6 +21,6 @@
"graphql": "^16.9.0",
"tsx": "^4.19.1",
"typescript": "^5.6.2",
"vitepress-sidebar": "^1.25.3"
"vitepress-sidebar": "^1.26.0"
}
}
Loading

0 comments on commit 94584a0

Please sign in to comment.