You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, Docsy shows the table of contents for the current page in the right sidebar using the built-in function of Hugo. You can replace that with a JavaScript-based ToC that uses the [https://tscanlin.github.io/tocbot/](Tocbot library) by setting the following in your `config.toml` file:
219
-
220
-
```toml
221
-
[params.jstoc]
222
-
enable = true
223
-
```
224
-
225
-
By default, h2-h4 headings are included in the sidebar, which includes tips and warnings if you are using the [alert shortcode of Docsy](/docs/adding-content/shortcodes/#alert). To change that,
226
-
provide a comma-separated list of the headings to include in the `custom_headings` parameter, for example:
227
-
228
-
```toml
229
-
[params.jstoc]
230
-
enable = true
231
-
custom_headings = "h2, h3"
232
-
```
233
-
234
-
Compared to the default sidebar ToC, this solution:
235
-
236
-
- has a marker that shows the current location of the screen (useful for long pages)
237
-
- shows the correct title even if the title contains a shortcode
238
-
- shows the title in the toc even if it was included from another file
239
-
240
-

241
-
242
216
## Customizing templates
243
217
244
218
### Add code to head or before body end
@@ -283,3 +257,28 @@ Both `head.html` and `scripts.html` are then used to build Docsy's [base page la
283
257
</html>
284
258
```
285
259
260
+
## Sidebar table of contents
261
+
262
+
By default, Docsy shows the table of contents for the current page in the right sidebar using the built-in function of Hugo. You can replace that with a JavaScript-based ToC that uses the [https://tscanlin.github.io/tocbot/](Tocbot library) by setting the following in your `config.toml` file:
263
+
264
+
```toml
265
+
[params.jstoc]
266
+
enable = true
267
+
```
268
+
269
+
By default, h2-h4 headings are included in the sidebar, which includes tips and warnings if you are using the [alert shortcode of Docsy](/docs/adding-content/shortcodes/#alert). To change that,
270
+
provide a comma-separated list of the headings to include in the `custom_headings` parameter, for example:
271
+
272
+
```toml
273
+
[params.jstoc]
274
+
enable = true
275
+
custom_headings = "h2, h3"
276
+
```
277
+
278
+
Compared to the default sidebar ToC, this solution:
279
+
280
+
- has a marker that shows the current location of the screen (useful for long pages)
281
+
- shows the correct title even if the title contains a shortcode
282
+
- shows the title in the toc even if it was included from another file
283
+
284
+

0 commit comments