File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed
docs/llm-inference-basics
src/theme/NavbarItem/DropdownNavbarItem/Desktop Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 2
2
sidebar_position : 1
3
3
sidebar_custom_props :
4
4
icon : /img/book.svg
5
+ collapsed : false
5
6
---
6
7
7
8
# LLM inference basics
Original file line number Diff line number Diff line change @@ -45,7 +45,21 @@ const config: Config = {
45
45
containerId : 'GTM-NLGDMK5'
46
46
} ,
47
47
docs : {
48
- routeBasePath : '/'
48
+ routeBasePath : '/' ,
49
+ sidebarItemsGenerator : async ( args ) => {
50
+ const { defaultSidebarItemsGenerator } = args
51
+ const items = await defaultSidebarItemsGenerator ( args )
52
+
53
+ return items . map ( ( item ) => {
54
+ if ( item . customProps ?. collapsed !== undefined ) {
55
+ return {
56
+ ...item ,
57
+ collapsed : Boolean ( item . customProps ?. collapsed )
58
+ }
59
+ }
60
+ return item
61
+ } )
62
+ }
49
63
} ,
50
64
theme : {
51
65
customCss : './src/css/custom.css'
Original file line number Diff line number Diff line change @@ -15,16 +15,13 @@ export default function DropdownNavbarItemDesktop({
15
15
} : Props ) : ReactNode {
16
16
const dropdownRef = useRef < HTMLDivElement > ( null )
17
17
const [ showDropdown , setShowDropdown ] = useState ( false )
18
- const isCardMode = useMemo ( ( ) => {
19
- console . log (
18
+ const isCardMode = useMemo (
19
+ ( ) =>
20
20
items . every (
21
21
( item ) => item . description && item . label && item . text && item . icon
22
- )
23
- )
24
- return items . every (
25
- ( item ) => item . description && item . label && item . text && item . icon
26
- )
27
- } , [ items ] )
22
+ ) ,
23
+ [ items ]
24
+ )
28
25
29
26
useEffect ( ( ) => {
30
27
const handleClickOutside = (
You can’t perform that action at this time.
0 commit comments