File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2222 < script > document . documentElement . setAttribute ( "data-theme" , localStorage . getItem ( "theme" ) || ( matchMedia ( "(prefers-color-scheme: dark)" ) . matches ?"dark" :"light" ) ) ; </ script >
2323 < script type ="importmap "> { { importMap } } </ script >
2424 < script type ="speculationrules "> { { speculationRules } } </ script >
25- < script async defer src ="./bootstrap.js " type ="text/javascript "> </ script >
25+ < script type ="text/javascript ">
26+ {
27+ function setupSidebarScroll ( ) {
28+ const sidebarLinks = document . querySelectorAll ( 'aside > section > ul > a' ) ;
29+
30+ let link ;
31+ for ( link of sidebarLinks ) {
32+ if ( link . pathname === window . location . pathname ) break ;
33+ }
34+
35+ if ( ! link ) return ;
36+
37+ link . scrollIntoView ( { behavior : 'smooth' , block : 'center' } ) ;
38+ }
39+
40+ function bootstrap ( ) {
41+ setupSidebarScroll ( ) ;
42+ }
43+
44+ if ( document . readyState === 'loading' ) {
45+ document . addEventListener ( 'DOMContentLoaded' , bootstrap , { once : true } ) ;
46+ } else {
47+ bootstrap ( ) ;
48+ }
49+ }
50+ </ script >
2651</ head >
2752
2853< body >
You can’t perform that action at this time.
0 commit comments