Update jekyll-toc with heading classes fix (#1337)
This commit is contained in:
parent
061103112e
commit
d980884d59
2 changed files with 14 additions and 10 deletions
|
@ -1,5 +1,7 @@
|
||||||
{% capture tocWorkspace %}
|
{% capture tocWorkspace %}
|
||||||
{%- comment -%}
|
{%- comment -%}
|
||||||
|
Version 1.0.2
|
||||||
|
|
||||||
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
|
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
@ -44,10 +46,11 @@
|
||||||
{% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
|
{% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
|
||||||
{% assign _workspace = node | split: '</h' %}
|
{% assign _workspace = node | split: '</h' %}
|
||||||
|
|
||||||
{% assign _idWorkspace = _workspace[0] | split: '"' %}
|
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
|
||||||
{% assign html_id = _idWorkspace[1] %}
|
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
|
||||||
|
{% assign html_id = _idWorkspace[0] %}
|
||||||
|
|
||||||
{% capture _hAttrToStrip %}{{ headerLevel }} id="{{ html_id }}">{% endcapture %}
|
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
|
||||||
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
|
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
|
||||||
|
|
||||||
{% assign space = '' %}
|
{% assign space = '' %}
|
||||||
|
@ -69,5 +72,4 @@
|
||||||
{% capture my_toc %}{: #{{ include.id }}}
|
{% capture my_toc %}{: #{{ include.id }}}
|
||||||
{{ my_toc | lstrip }}{% endcapture %}
|
{{ my_toc | lstrip }}{% endcapture %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}{% assign tocWorkspace = '' %}
|
{% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
|
||||||
{{ my_toc | markdownify }}
|
|
|
@ -1,5 +1,7 @@
|
||||||
{% capture tocWorkspace %}
|
{% capture tocWorkspace %}
|
||||||
{%- comment -%}
|
{%- comment -%}
|
||||||
|
Version 1.0.2
|
||||||
|
|
||||||
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
|
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
@ -44,10 +46,11 @@
|
||||||
{% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
|
{% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
|
||||||
{% assign _workspace = node | split: '</h' %}
|
{% assign _workspace = node | split: '</h' %}
|
||||||
|
|
||||||
{% assign _idWorkspace = _workspace[0] | split: '"' %}
|
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
|
||||||
{% assign html_id = _idWorkspace[1] %}
|
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
|
||||||
|
{% assign html_id = _idWorkspace[0] %}
|
||||||
|
|
||||||
{% capture _hAttrToStrip %}{{ headerLevel }} id="{{ html_id }}">{% endcapture %}
|
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
|
||||||
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
|
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
|
||||||
|
|
||||||
{% assign space = '' %}
|
{% assign space = '' %}
|
||||||
|
@ -69,5 +72,4 @@
|
||||||
{% capture my_toc %}{: #{{ include.id }}}
|
{% capture my_toc %}{: #{{ include.id }}}
|
||||||
{{ my_toc | lstrip }}{% endcapture %}
|
{{ my_toc | lstrip }}{% endcapture %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}{% assign tocWorkspace = '' %}
|
{% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
|
||||||
{{ my_toc | markdownify }}
|
|
Loading…
Reference in a new issue