From d8eaf02c60b31703386e32770ad18c94b5d0f91f Mon Sep 17 00:00:00 2001 From: Vladimir Jimenez Date: Fri, 10 Jan 2020 20:29:26 -0800 Subject: [PATCH 1/2] Add .jekyll-cache to our gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index dcc0777..fb6e397 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ _site .sass-cache +.jekyll-cache .jekyll-metadata Gemfile.lock vendor From 85c533f3e1c98010a911ba7b00e079e613986ac3 Mon Sep 17 00:00:00 2001 From: Vladimir Jimenez Date: Fri, 10 Jan 2020 20:30:55 -0800 Subject: [PATCH 2/2] Fix empty `item_class` logic kramdown is nice enough to trim and ignore `{:.}` but it was still being generated on list items, which is incorrect behavior. This inadvertently, partially fixes redcarpet support Fixes #28 --- _includes/toc.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_includes/toc.html b/_includes/toc.html index 25b9f6a..3d807c7 100644 --- a/_includes/toc.html +++ b/_includes/toc.html @@ -1,6 +1,6 @@ {% capture tocWorkspace %} {% comment %} - Version 1.0.8 + Version 1.0.9 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 @@ -75,16 +75,16 @@ {% assign space = space | prepend: ' ' %} {% endfor %} - {% unless include.item_class == blank %} + {% if include.item_class and include.item_class != blank %} {% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %} - {% endunless %} + {% endif %} {% capture heading_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %} {% capture my_toc %}{{ my_toc }} {{ space }}{{ listModifier }} {{ listItemClass }} [{{ heading_body | replace: "|", "\|" }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %} {% endfor %} - {% if include.class %} + {% if include.class and include.item_class != blank %} {% capture my_toc %}{:.{{ include.class }}} {{ my_toc | lstrip }}{% endcapture %} {% endif %}