File tree Expand file tree Collapse file tree 2 files changed +54
-1
lines changed Expand file tree Collapse file tree 2 files changed +54
-1
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,32 @@ header a {
33
33
text-decoration : none;
34
34
}
35
35
36
+ .toc {
37
+ position : fixed;
38
+ right : 2em ;
39
+ top : 7em ;
40
+ padding : 1em ;
41
+ border : 1px solid # ddd ;
42
+ background-color : # fff ;
43
+ font-size : smaller;
44
+ width : 135px ;
45
+ }
46
+
47
+ .toc ul {
48
+ list-style : none;
49
+ padding-left : 0 ;
50
+ margin : 0 ;
51
+ white-space : nowrap;
52
+ overflow : hidden;
53
+ text-overflow : ellipsis;
54
+ }
55
+
56
+ .toc ul ul {
57
+ padding-left : 1em ;
58
+ }
59
+
36
60
main {
37
- max-width : 768 px ;
61
+ max-width : 765 px ;
38
62
margin : 3em auto;
39
63
padding : 1em ;
40
64
}
54
78
h2 , h3 , h4 {
55
79
border-bottom : 1px solid darkorange;
56
80
font-weight : normal;
81
+ padding-top : 48px ;
82
+ margin-top : -24px ;
57
83
}
58
84
59
85
time {
@@ -150,4 +176,21 @@ blockquote {
150
176
151
177
.profile : hover {
152
178
box-shadow : 2px 2px 10px # ddd ;
179
+ }
180
+
181
+ @media (max-width : 1100px ) {
182
+ main {
183
+ margin-left : 0 ;
184
+ }
185
+ .toc {
186
+ right : 0 ;
187
+ }
188
+ }
189
+ @media (max-width : 950px ) {
190
+ main {
191
+ max-width : 100% ;
192
+ }
193
+ .toc {
194
+ display : none;
195
+ }
153
196
}
Original file line number Diff line number Diff line change 7
7
< header >
8
8
{{ partial "header.html" . }}
9
9
</ header >
10
+ {{ if .IsPage }}
11
+ {{ with .TableOfContents }}
12
+ {{ if ne . "< nav id =\ "TableOfContents\"> </ nav > " }}
13
+ < div class ="toc ">
14
+ < strong > Table of Contents</ strong >
15
+ {{ . }}
16
+ </ div >
17
+ {{ end }}
18
+ {{ end }}
19
+ {{ end }}
10
20
< main >
11
21
{{ block "main" . }}{{ end }}
12
22
</ main >
You can’t perform that action at this time.
0 commit comments