diff --git a/_includes/toc.html b/_includes/toc.html index 6971739..5090156 100644 --- a/_includes/toc.html +++ b/_includes/toc.html @@ -1,6 +1,6 @@ {% capture tocWorkspace %} {% comment %} - Version 1.0.11 + Version 1.0.12 https://github.com/allejo/jekyll-toc "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe @@ -55,12 +55,6 @@ {% continue %} {% endif %} - {% if firstHeader %} - {% assign firstHeader = false %} - {% assign minHeader = headerLevel %} - {% endif %} - - {% assign indentAmount = headerLevel | minus: minHeader %} {% assign _workspace = node | split: '' | first }}>{% endcapture %} {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} + {% assign indentAmount = headerLevel | minus: minHeader %} {% assign space = '' %} {% for i in (1..indentAmount) %} {% assign space = space | prepend: ' ' %} diff --git a/_tests/noTocForFirstHeading copy.md b/_tests/noTocForFirstHeading copy.md new file mode 100644 index 0000000..25f0d97 --- /dev/null +++ b/_tests/noTocForFirstHeading copy.md @@ -0,0 +1,37 @@ +--- +# See https://github.com/allejo/jekyll-toc/issues/35 +--- + +{% capture markdown %} +## skip me +{: .no_toc} + +## skip me also +{: .no_toc} + +## skip me, too... +{: .no_toc} + +## skip me last +{: .no_toc} + +### also skip me as a subheading! +{: .no_toc} + +### Subheading A + +### Subheading B + +### Subheading C +{% endcapture %} +{% assign text = markdown | markdownify %} + +{% include toc.html html=text %} + + + +