Skip to content

Commit

Permalink
docs: rewrite guides/sidebar examples to be more generic (#1751)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Swithinbank <[email protected]>
Co-authored-by: Yan <[email protected]>
  • Loading branch information
3 people authored Apr 15, 2024
1 parent 1219758 commit 36715ed
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 126 deletions.
5 changes: 4 additions & 1 deletion docs/src/components/sidebar-preview.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ function makeEntries(items: SidebarConfig): SidebarEntry[] {
return {
type: 'link',
label: item.label,
href: item.link,
// Empty hrefs are used to represent internal links that do not exist in the Starlight
// docs. Using a non-existing anchor link like `#_` will not trigger a page reload or any
// scrolling.
href: item.link.length > 0 ? item.link : '#_',
isCurrent: false,
badge: item.badge,
attrs: item.attrs ?? {},
Expand Down
Loading

0 comments on commit 36715ed

Please sign in to comment.