diff --git a/_includes/toc_pure_liquid.html b/_includes/toc_pure_liquid.html index bf2b4c166d..84bd122d9c 100644 --- a/_includes/toc_pure_liquid.html +++ b/_includes/toc_pure_liquid.html @@ -45,7 +45,7 @@ {% assign html_id = _idWorkspace[1] %} {% capture _hAttrToStrip %}{{ headerLevel }} id="{{ html_id }}">{% endcapture %} - {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} + {% assign header = _workspace[0] | replace: _hAttrToStrip, '' | remove_first: "1>" %} {% assign space = '' %} {% for i in (1..indentAmount) %} diff --git a/_layouts/docs.html b/_layouts/docs.html index 7b13136b57..0c6c0fba4c 100644 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -289,8 +289,19 @@ ng\:form { {% assign my_min = page.toc_min | default: site.toc_min | default: 2 %} {% assign my_max = page.toc_max | default: site.toc_max | default: 3 %} {% assign my_name = page.url | default: "unnamed" %} -
On this page:
{% include toc_pure_liquid.html html=content sanitize=true class="inline_toc" id="my_toc" toc_min=my_min toc_max=my_max page_name=my_name %}
+ {% if my_min < 2 %} + {% comment %} + the 'content' variable doesn't include the

by default + so if we request the h1 heading to be in the in-page TOC, + append it to the content before we pass it to the TOC generator + {% endcomment %} + {% assign my_content = "

" | append: page.title | append: "

" | append: content %} + {% else %} + {% assign my_content = content %} + {% endif %} +
On this page:
{% include toc_pure_liquid.html html=my_content sanitize=true class="inline_toc" id="my_toc" toc_min=my_min toc_max=my_max page_name=my_name %}
{% endunless %} +
{{content}}