diff --git a/_includes/toc_heading_custom.html b/_includes/toc_heading_custom.html new file mode 100644 index 0000000000000000000000000000000000000000..82a77005b705766c0d303793e2d661fabc0b39f6 --- /dev/null +++ b/_includes/toc_heading_custom.html @@ -0,0 +1 @@ +<h2 class="text-delta">Table of contents</h2> diff --git a/_layouts/default.html b/_layouts/default.html index 5acf1c93505f9252f6021f7eb530c6ae8c9ec068..6e95317e75bb621ad31b02b79959183549c1b875 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -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> diff --git a/docs/customization.md b/docs/customization.md index 385b2e18c5a0b21dead578a50a71d8ef706dab3c..ec9be2642eea51b11215b5b06f536620268511c3 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -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