File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 45
45
{% assign html_id = _idWorkspace[1] %}
46
46
47
47
{% capture _hAttrToStrip %}{{ headerLevel }} id="{{ html_id }}"> {% endcapture %}
48
- {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
48
+ {% assign header = _workspace[0] | replace: _hAttrToStrip, '' | remove_first: "1 > " %}
49
49
50
50
{% assign space = '' %}
51
51
{% for i in (1..indentAmount) %}
Original file line number Diff line number Diff line change 289
289
{% assign my_min = page.toc_min | default: site.toc_min | default: 2 %}
290
290
{% assign my_max = page.toc_max | default: site.toc_max | default: 3 %}
291
291
{% assign my_name = page.url | default: "unnamed" %}
292
- < div id ="side-toc "> < div id ="side-toc-title "> On this page:</ div > < div id ="side-toc-contents "> {% 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 %}</ div > </ div >
292
+ {% if my_min < 2 %}
293
+ {% comment %}
294
+ the 'content' variable doesn't include the < h1> by default
295
+ so if we request the h1 heading to be in the in-page TOC,
296
+ append it to the content before we pass it to the TOC generator
297
+ {% endcomment %}
298
+ {% assign my_content = "< h1 > " | append: page.title | append: "</ h1 > " | append: content %}
299
+ {% else %}
300
+ {% assign my_content = content %}
301
+ {% endif %}
302
+ < div id ="side-toc "> < div id ="side-toc-title "> On this page:</ div > < div id ="side-toc-contents "> {% 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 %}</ div > </ div >
293
303
{% endunless %}
304
+ < div > {{content}}</ div >
294
305
</ section >
295
306
</ div >
296
307
</ div >
You can’t perform that action at this time.
0 commit comments