File tree Expand file tree Collapse file tree 4 files changed +49
-13
lines changed Expand file tree Collapse file tree 4 files changed +49
-13
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,19 @@ h3.plumbing {
111
111
& #reference-languages-trigger {
112
112
float : right ;
113
113
}
114
+
115
+ // Ensure the TOC trigger floats right like topics/languages
116
+ & #reference-toc-trigger {
117
+ float : right ;
118
+ }
119
+ }
120
+
121
+ // Place the "last updated" span inline next to the left-floating versions trigger
122
+ > span .light {
123
+ display : inline-block ;
124
+ clear : none ;
125
+ margin-left : 6px ;
126
+ vertical-align : middle ;
114
127
}
115
128
}
116
129
@@ -213,6 +226,28 @@ h3.plumbing {
213
226
}
214
227
}
215
228
229
+ // Position the Table of Contents dropdown under the right-floated TOC trigger
230
+ #toc-dropdown {
231
+ width : 300px ;
232
+ right : 12px ;
233
+ padding : 12px ;
234
+ font-weight : normal ;
235
+ line-height : 1 ;
236
+
237
+ ul {
238
+ margin : 0 ;
239
+ }
240
+
241
+ li {
242
+ line-height : $base-line-height * 0.8 ;
243
+ }
244
+
245
+ a {
246
+ font-weight : normal ;
247
+ padding : 0 ;
248
+ }
249
+ }
250
+
216
251
ol .reference-previous-versions {
217
252
@extend .unstyled !optional ;
218
253
margin-top : 3px ;
Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ <h1>{{ .Params.book.section.cs_number }} {{ .Params.book.chapter.title }} - {{ .
123
123
< div id ='reference-version '>
124
124
{{ partial "ref/languages.html" . }}
125
125
{{ partial "ref/topics.html" . }}
126
+ {{ partial "ref/toc.html" . }}
126
127
{{ partial "ref/versions.html" . }}
127
128
</ div >
128
129
Original file line number Diff line number Diff line change
1
+ {{ $headings := .Params.headings }}
2
+ {{ if $headings }}
3
+ < a class ="dropdown-trigger " id ="reference-toc-trigger " data-panel-id ="toc-dropdown " href ="# "> Table of Contents ▾</ a >
4
+ < div class ='dropdown-panel right ' id ='toc-dropdown '>
5
+ < div >
6
+ < ul class ="toc ">
7
+ {{ range $i, $item := $headings }}
8
+ < li > < a href ="#{{ .id }} "> {{ .text }}</ a > </ li >
9
+ {{ end }}
10
+ </ ul >
11
+ </ div >
12
+ </ div >
13
+ {{ end }}
Original file line number Diff line number Diff line change 50
50
</ li >
51
51
</ ul >
52
52
53
- {{ $headings := .Params.headings }}
54
- {{ if $headings }}
55
- < ul >
56
- < li > Table of Contents
57
- < ul class ="expanded ">
58
- {{ range $i, $item := $headings }}
59
- < li > < a href ="#{{ .id }} "> {{ .text }}</ a > </ li >
60
- {{ end }}
61
- </ ul >
62
- </ li >
63
- </ ul >
64
- {{ end }}
65
-
66
53
{{ if (eq .Params.Sidebar "book") }}
67
54
< hr class ="sidebar ">
68
55
{{- /* If this page displays a section of the ProGit book, map all the translations thereof */ -}}
You can’t perform that action at this time.
0 commit comments