Skip to content
Snippets Groups Projects
Unverified Commit 6061dd27 authored by Peter Mosses's avatar Peter Mosses Committed by GitHub
Browse files

Add custom include for TOC heading (#980)

Closes #961. Replays a previous attempt.
parent e91df1e4
No related branches found
No related tags found
No related merge requests found
<h2 class="text-delta">Table of contents</h2>
......@@ -159,7 +159,7 @@ layout: table_wrappers
{% if page.has_children == true and page.has_toc != false %}
<hr>
<h2 class="text-delta">Table of contents</h2>
{% include toc_heading_custom.html %}
<ul>
{% for child in toc_list %}
<li>
......
......@@ -129,11 +129,27 @@ For example, if you'd like to add your own styles for printing a page, you could
## Override includes
The site can be modified by overriding any of the custom [Jekyll includes](https://jekyllrb.com/docs/includes/) provided by default in the theme.
You can customize the theme by overriding any of the custom [Jekyll includes](https://jekyllrb.com/docs/includes/) files that it provides.
To do this, create an `_includes` directory and make a copy of the specific file you wish to modify. Any content added to this file will override the theme defaults. You can learn more about this process in the Jekyll docs for [Overriding theme defaults](https://jekyllrb.com/docs/themes/#overriding-theme-defaults).
To do this, create an `_includes` directory and make a copy of the specific file you wish to modify. The content in this file will override the theme defaults. You can learn more about this process in the Jekyll docs for [Overriding theme defaults](https://jekyllrb.com/docs/themes/#overriding-theme-defaults).
The following includes were made available to you:
Just the Docs provides the following custom includes files:
### Custom TOC Heading
`_includes/toc_heading_custom.html`
If the page has any child pages, and `has_toc` is not set to `false`, this content appears as a heading above the [auto-generating list of child pages]({{ site.baseurl }}{% link docs/navigation-structure.md %}#auto-generating-table-of-contents) after the page's content.
#### Example
{: .no_toc }
To change the default TOC heading to "Contents", create `_includes/toc_heading_custom.html` and add:
```html
<h2 class="text-delta">Contents</h2>
```
The (optional) `text-delta` class makes the heading appear as **Contents**{:.text-delta} .
### Custom Footer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment