Skip to content

Commit fcd9765

Browse files
authored
DOCS-3737: Move TOC (#4145)
1 parent 2aa8e2e commit fcd9765

File tree

7 files changed

+56
-37
lines changed

7 files changed

+56
-37
lines changed

Diff for: assets/scss/_sidebar-tree.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@
144144
@include media-breakpoint-up(md) {
145145
@supports (position: sticky) {
146146
position: sticky;
147-
top: 4rem;
147+
top: 5rem;
148148
z-index: 10;
149-
height: calc(100vh - 4rem);
149+
height: calc(100vh - 5rem);
150150
}
151151
}
152152

Diff for: assets/scss/_styles_project.scss

+23-3
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ h7, .h7 {
201201
}
202202

203203
.td-sidebar-toc {
204+
top: 6rem;
204205
border-left: unset;
206+
height: calc(100vh - 10rem);
205207
}
206208

207209
// Breadcrumb styling
@@ -1261,6 +1263,12 @@ td > ul, td > ol {
12611263
animation: linear 2s wiggle 2s 2;
12621264
}
12631265

1266+
@media (min-width: 992px) {
1267+
#scrollButton {
1268+
margin-right: 10%;
1269+
}
1270+
}
1271+
12641272
#chatButtonContent {
12651273
display: flex;
12661274
justify-content: space-evenly;
@@ -1399,7 +1407,7 @@ img.frame {
13991407
// This ensures the gray sidebar covers the area where the sticky buttons are rendered.
14001408
@media (min-width: 768px) {
14011409
.td-sidebar {
1402-
padding-bottom: 76px;
1410+
// padding-bottom: 76px;
14031411
margin-bottom: -76px;
14041412
}
14051413
}
@@ -2027,7 +2035,7 @@ a.ais-Pagination-link:hover {
20272035
// ensure tutorials page is 100% of height
20282036

20292037
.row.flex-xl-nowrap {
2030-
min-height: 90%;
2038+
min-height: 100%;
20312039
}
20322040

20332041

@@ -3327,4 +3335,16 @@ div.tablestep > table td, div.tablestep table td {
33273335
margin-top: 1rem;
33283336
}
33293337

3330-
// Numbered list styling END
3338+
footer.py-5 {
3339+
padding-bottom: 0 !important;
3340+
padding-top: 1rem !important;
3341+
margin-bottom: -2rem !important;
3342+
}
3343+
3344+
.td-main main {
3345+
padding-bottom: 0rem !important;
3346+
}
3347+
3348+
footer {
3349+
min-height: 30px !important;
3350+
}// Numbered list styling END

Diff for: layouts/docs/baseof.html

+6-11
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@
2121
</aside>
2222
{{ if .Params.noToc }}
2323
{{ else }}
24+
<aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none">
25+
{{ partial "page-meta-links.html" . }}
26+
{{ partial "toc.html" . }}
27+
{{ partial "taxonomy_terms_clouds.html" . }}
28+
</aside>
2429
{{ end }}
25-
<main class="col-12 col-md-9 {{ if .Params.noToc }}col-xl-10{{ else }}col-xl-10{{ end }} pl-md-5" role="main">
30+
<main class="col-12 col-md-9 {{ if .Params.noToc }}col-xl-10{{ else }}col-xl-8{{ end }} pl-md-5" role="main">
2631
{{ partial "version-banner.html" . }}
2732
{{ if ne .Params.noedit true }}
2833
{{ partial "edit-on-github.html" . }}
@@ -34,17 +39,7 @@
3439
</main>
3540
{{ $img := resources.GetMatch "/icons/learn-viam-robot-icon-ai.svg" }}
3641
</div>
37-
<button class="docsbutton" id="chatButton" title="Chatbot and support">
38-
<span id="chatButtonContent">
39-
<i style="font-size:x-large;" class="fas fa-comments"></i>
40-
<span>Ask AI</span>
41-
</span>
42-
</button>
43-
<button onclick="toTop()" class="docsbutton" id="scrollButton" title="Go to top" style="visibility: hidden;">
44-
<i style="font-size:x-large;" class="fas fa-chevron-up"></i>
45-
</button>
4642
</div>
47-
{{ partial "footer.html" . }}
4843
</div>
4944
{{ partial "scripts.html" . }}
5045
</body>

Diff for: layouts/docs/content.html

+13-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ <h4 class="alert-heading">DRAFT</h4>
4747

4848
{{ .Content }}
4949

50+
<button class="docsbutton" id="chatButton" title="Chatbot and support">
51+
<span id="chatButtonContent">
52+
<i style="font-size:x-large;" class="fas fa-comments"></i>
53+
<span>Ask AI</span>
54+
</span>
55+
</button>
56+
<button onclick="toTop()" class="docsbutton" id="scrollButton" title="Go to top" style="visibility: hidden;">
57+
<i style="font-size:x-large;" class="fas fa-chevron-up"></i>
58+
</button>
59+
5060
{{ if ne .Params.no_list true}}
5161
{{ $pages := union .Sections .Pages }}
5262
<div id="next-page" class="card-container">
@@ -90,4 +100,6 @@ <h4 class="alert-heading">DRAFT</h4>
90100
{{ partial "feedback.html" . }}
91101
<br />
92102
{{ end }}{{- end -}}
93-
</div>
103+
</div>
104+
105+
{{ partial "footer.html" . }}

Diff for: layouts/docs/landing.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
</span>
3232
</button>
3333
</div>
34-
{{ partial "footer.html" . }}
35-
</div>
34+
35+
</div>
3636

3737
{{ partial "scripts.html" . }}
3838

Diff for: layouts/partials/footer.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
<footer class="bg-dark py-5 row d-print-none">
33
<div class="container-fluid mx-sm-5">
44
<div class="row">
5-
<div class="col-6 col-sm-4 text-xs-center order-sm-2">
6-
{{ with $links }}
5+
<div class="col-2 col-sm-2 text-xs-center order-sm-2">
6+
<!-- {{ with $links }}
77
{{ with index . "user"}}
88
{{ template "footer-links-block" . }}
99
{{ end }}
10-
{{ end }}
10+
{{ end }} -->
1111
</div>
12-
<div class="col-6 col-sm-4 text-right text-xs-center order-sm-3">
13-
{{ with $links }}
12+
<div class="col-6 col-sm-2 text-right text-xs-center order-sm-3">
13+
<!-- {{ with $links }}
1414
{{ with index . "developer"}}
1515
{{ template "footer-links-block" . }}
1616
{{ end }}
17-
{{ end }}
17+
{{ end }} -->
1818
</div>
19-
<div class="col-12 col-sm-4 text-center py-2 order-sm-2">
19+
<div class="col-12 col-sm-8 text-center py-2 order-sm-2">
2020
{{ with .Site.Params.copyright }}<small class="text-white">&copy; {{ now.Year}} {{ .}} {{ T "footer_all_rights_reserved" }}</small><BR>{{ end }}
2121
{{ with .Site.Params.privacy_policy }}<small class="ml-2"><a href="{{ . }}" target="_blank" rel="noopener">{{ "PRIVACY POLICY" }}</a></small>{{ end }}
2222
{{ with .Site.Params.tos_statement }}<small class="ml-2"><a href="{{ . }}" target="_blank" rel="noopener">{{ "TERMS" }}</a></small> {{ end }}
@@ -32,7 +32,7 @@
3232
</div>
3333
</div>
3434
</footer>
35-
{{ define "footer-links-block" }}
35+
<!-- {{ define "footer-links-block" }}
3636
<ul class="list-inline mb-0">
3737
{{ range . }}
3838
<li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="{{ .name }}" aria-label="{{ .name }}">
@@ -42,4 +42,4 @@
4242
</li>
4343
{{ end }}
4444
</ul>
45-
{{ end }}
45+
{{ end }} -->

Diff for: layouts/partials/sidebar-tree.html

+1-9
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@
5959
<span> Tutorials </span>
6060
</a>
6161
<li class="active-path tutorial-heading">
62-
<a href="" title="{{ $p.Title }}" class="active">{{ $p.LinkTitle }}
63-
</a>
64-
<div class="td-toc" id="TableOfContents"></div>
62+
<a href="" title="{{ $p.Title }}" class="active">{{ $p.LinkTitle }}</a>
6563
</li>
6664
{{ else }}
6765

@@ -105,19 +103,13 @@
105103
{{- end -}}
106104
</span>
107105
</span>
108-
{{- if and ($active) (not .Params.notoc) -}}
109-
<div class="td-toc" id="TableOfContents"></div>
110-
{{- end -}}
111106
{{ else }}
112107
{{ if $s.Params.canonical }}
113108
<a href="{{$s.Params.canonical | relURL}}"{{ if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end }}{{ with $s.Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }}>{{ $s.LinkTitle }} <i class="fas fa-external-link-alt fa-sm"></i>
114109
</a>
115110
{{ else }}
116111
<a href="{{ $manualLink }}"{{ if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end }}{{ with $s.Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }} class="{{ if $active}} active{{ end }}{{ if $treeRoot }} tree-root{{ end }}">{{ $s.LinkTitle }}
117112
</a>
118-
{{- if and ($active) (not .Params.notoc) -}}
119-
<div class="td-toc" id="TableOfContents"></div>
120-
{{- end -}}
121113
{{- end }}
122114
{{ end }}
123115
{{- end }}

0 commit comments

Comments
 (0)