File tree 4 files changed +23
-5
lines changed
4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ var siteConfig = {
28
28
// we get an error without this, here, though
29
29
"steal-stache" : "^4.0.1" ,
30
30
"steal-conditional" : "^0.3.6" ,
31
- "bit-docs-html-codepen-link" : "^1.0.0"
31
+ "bit-docs-html-codepen-link" : "^1.0.0" ,
32
+ "bit-docs-html-toc" : "^1.1.1"
32
33
} ,
33
34
staticDist : [
34
35
path . join ( __dirname , "dist" , "static" )
Original file line number Diff line number Diff line change @@ -156,6 +156,18 @@ function init() {
156
156
sidebarViewModel . selectedPageName = window . docObject . name ;
157
157
}
158
158
159
+ // Set up the client-side TOC
160
+ var tocContainer = document . querySelector ( "#toc-sidebar" ) ;
161
+ var oldToc = document . querySelector ( "bit-toc" ) ;
162
+ if ( oldToc ) {
163
+ tocContainer . removeChild ( oldToc ) ;
164
+ }
165
+ var newToc = document . createElement ( "bit-toc" ) ;
166
+ newToc . depth = window . docObject . outline ;
167
+ newToc . headingContainerSelector = "#right > article" ;
168
+ newToc . scrollSelector = "#toc-sidebar" ;
169
+ tocContainer . appendChild ( newToc ) ;
170
+
159
171
hasShownSearch = true ;
160
172
}
161
173
Original file line number Diff line number Diff line change 5
5
transition : padding- bottom @transition-speed ease ;
6
6
display :-ms-grid ;
7
7
display : grid ;
8
- -ms-grid-columns : 300px 1fr ;
9
- grid-template-columns : max-content 1fr ;
10
- grid-template-areas : " header header" " left- nav content" ;
8
+ -ms-grid-columns : 300px 1fr 300 px ;
9
+ grid-template-columns : max-content 1fr max-content ;
10
+ grid-template-areas : " header header header " " nav-sidebar content toc-sidebar " ;
11
11
}
12
12
#left {
13
13
-ms-grid-row : 2 ;
14
14
-ms-grid-column : 1 ;
15
15
-ms-grid-column-span : 1 ;
16
- grid-area : left - nav;
16
+ grid-area : nav- sidebar ;
17
17
height : calc (~ " 100vh - " @brand-height );// 53px header
18
18
overflow-y : scroll ;
19
19
position : fixed ;
40
40
.transition-left ;
41
41
flex-grow : 1 ;
42
42
}
43
+ #toc-sidebar {
44
+ grid-area : toc- sidebar;
45
+ }
43
46
.column {
44
47
height : 100% ;
45
48
overflow-y : auto ;
Original file line number Diff line number Diff line change 22
22
{ {/with} }
23
23
24
24
</div >
25
+ <div class =" column" id =" toc-sidebar" >
26
+ </div >
25
27
</div >
You can’t perform that action at this time.
0 commit comments