File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 7
7
{% endif %}
8
8
</ div >
9
9
</ nav >
10
+
11
+ < script >
12
+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
13
+ if ( window . location . pathname . includes ( '/reference/' ) ) {
14
+ const navContainer = document . querySelector ( '#bd-docs-nav .bd-toc-item' ) ;
15
+ if ( navContainer ) {
16
+ const topLevelItems = Array . from ( navContainer . children ) ;
17
+
18
+ topLevelItems . forEach ( section => {
19
+ const subLists = section . querySelectorAll ( 'ul' ) ;
20
+ subLists . forEach ( list => {
21
+ const items = Array . from ( list . children ) ;
22
+
23
+ items . sort ( ( a , b ) => {
24
+ const textA = a . textContent . trim ( ) . toLowerCase ( ) ;
25
+ const textB = b . textContent . trim ( ) . toLowerCase ( ) ;
26
+ return textA . localeCompare ( textB ) ;
27
+ } ) ;
28
+
29
+ items . forEach ( item => list . appendChild ( item ) ) ;
30
+ } ) ;
31
+ } ) ;
32
+ }
33
+ }
34
+ } ) ;
35
+ </ script >
You can’t perform that action at this time.
0 commit comments