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 {
111111 & #reference-languages-trigger {
112112 float : right ;
113113 }
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 ;
114127 }
115128}
116129
@@ -213,6 +226,28 @@ h3.plumbing {
213226 }
214227}
215228
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+
216251ol .reference-previous-versions {
217252 @extend .unstyled !optional ;
218253 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 }} - {{ .
123123 < div id ='reference-version '>
124124 {{ partial "ref/languages.html" . }}
125125 {{ partial "ref/topics.html" . }}
126+ {{ partial "ref/toc.html" . }}
126127 {{ partial "ref/versions.html" . }}
127128 </ div >
128129
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 5050 </ li >
5151 </ ul >
5252
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-
6653 {{ if (eq .Params.Sidebar "book") }}
6754 < hr class ="sidebar ">
6855 {{- /* 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