minimal-mistakes-jekyll 4.19.3 → 4.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +83 -0
  3. data/README.md +6 -7
  4. data/_data/ui-text.yml +188 -40
  5. data/_includes/archive-single.html +3 -5
  6. data/_includes/author-profile.html +1 -1
  7. data/_includes/category-list.html +2 -9
  8. data/_includes/documents-collection.html +6 -12
  9. data/_includes/figure +2 -2
  10. data/_includes/footer.html +3 -1
  11. data/_includes/head.html +5 -2
  12. data/_includes/page__hero.html +7 -5
  13. data/_includes/page__hero_video.html +2 -4
  14. data/_includes/page__meta.html +30 -0
  15. data/_includes/scripts.html +0 -1
  16. data/_includes/search/algolia-search-scripts.html +10 -3
  17. data/_includes/seo.html +3 -0
  18. data/_includes/tag-list.html +2 -9
  19. data/_includes/toc.html +128 -42
  20. data/_includes/video +20 -11
  21. data/_layouts/categories.html +3 -2
  22. data/_layouts/category.html +3 -2
  23. data/_layouts/collection.html +3 -2
  24. data/_layouts/default.html +2 -2
  25. data/_layouts/home.html +6 -3
  26. data/_layouts/posts.html +5 -4
  27. data/_layouts/single.html +2 -4
  28. data/_layouts/tag.html +3 -2
  29. data/_layouts/tags.html +3 -2
  30. data/_sass/minimal-mistakes.scss +2 -2
  31. data/_sass/minimal-mistakes/_archive.scss +9 -1
  32. data/_sass/minimal-mistakes/_footer.scss +0 -1
  33. data/_sass/minimal-mistakes/_navigation.scss +7 -0
  34. data/_sass/minimal-mistakes/_notices.scss +1 -0
  35. data/_sass/minimal-mistakes/_page.scss +6 -0
  36. data/_sass/minimal-mistakes/_sidebar.scss +0 -1
  37. data/_sass/minimal-mistakes/skins/_contrast.scss +2 -1
  38. data/_sass/minimal-mistakes/skins/_dark.scss +3 -1
  39. data/_sass/minimal-mistakes/skins/_mint.scss +1 -0
  40. data/_sass/minimal-mistakes/skins/_neon.scss +3 -1
  41. data/_sass/minimal-mistakes/skins/_plum.scss +3 -1
  42. data/_sass/minimal-mistakes/skins/_sunrise.scss +4 -2
  43. data/assets/js/_main.js +2 -2
  44. data/assets/js/lunr/lunr-en.js +1 -1
  45. data/assets/js/lunr/lunr-gr.js +1 -1
  46. data/assets/js/lunr/lunr-store.js +3 -3
  47. data/assets/js/lunr/lunr.js +67 -76
  48. data/assets/js/lunr/lunr.min.js +6 -1
  49. data/assets/js/main.min.js +3 -6
  50. data/assets/js/plugins/jquery.greedy-navigation.js +67 -15
  51. data/assets/js/vendor/jquery/{jquery-3.4.1.js → jquery-3.5.1.js} +756 -482
  52. metadata +5 -5
  53. data/_includes/read-time.html +0 -15
@@ -10,23 +10,21 @@
10
10
  {% assign title = post.title %}
11
11
  {% endif %}
12
12
 
13
- <div class="{{ include.type | default: "list" }}__item">
13
+ <div class="{{ include.type | default: 'list' }}__item">
14
14
  <article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
15
15
  {% if include.type == "grid" and teaser %}
16
16
  <div class="archive__item-teaser">
17
17
  <img src="{{ teaser | relative_url }}" alt="">
18
18
  </div>
19
19
  {% endif %}
20
- <h2 class="archive__item-title" itemprop="headline">
20
+ <h2 class="archive__item-title no_toc" itemprop="headline">
21
21
  {% if post.link %}
22
22
  <a href="{{ post.link }}">{{ title }}</a> <a href="{{ post.url | relative_url }}" rel="permalink"><i class="fas fa-link" aria-hidden="true" title="permalink"></i><span class="sr-only">Permalink</span></a>
23
23
  {% else %}
24
24
  <a href="{{ post.url | relative_url }}" rel="permalink">{{ title }}</a>
25
25
  {% endif %}
26
26
  </h2>
27
- {% if post.read_time %}
28
- <p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i> {% include read-time.html %}</p>
29
- {% endif %}
27
+ {% include page__meta.html type=include.type %}
30
28
  {% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify | strip_html | truncate: 160 }}</p>{% endif %}
31
29
  </article>
32
30
  </div>
@@ -17,7 +17,7 @@
17
17
 
18
18
  <div class="author__content">
19
19
  {% if author.home %}
20
- <a href="{{ author_link }}"><h3 class="author__name" itemprop="name">{{ author.name }}</h3></a>
20
+ <a href="{{ author.home | relative_url }}"><h3 class="author__name" itemprop="name">{{ author.name }}</h3></a>
21
21
  {% else %}
22
22
  <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
23
23
  {% endif %}
@@ -6,19 +6,12 @@
6
6
  {% endcase %}
7
7
 
8
8
  {% if site.category_archive.path %}
9
- {% comment %}
10
- <!-- Sort alphabetically regardless of case e.g. a B c d E -->
11
- <!-- modified from http://www.codeofclimber.ru/2015/sorting-site-tags-in-jekyll/ -->
12
- {% endcomment %}
13
- {% capture page_categories %}{% for category in page.categories %}{{ category | downcase }}|{{ category }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
14
- {% assign category_hashes = page_categories | split: ',' | sort %}
9
+ {% assign categories_sorted = page.categories | sort_natural %}
15
10
 
16
11
  <p class="page__taxonomy">
17
12
  <strong><i class="fas fa-fw fa-folder-open" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].categories_label | default: "Categories:" }} </strong>
18
13
  <span itemprop="keywords">
19
- {% for hash in category_hashes %}
20
- {% assign keyValue = hash | split: '|' %}
21
- {% capture category_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %}
14
+ {% for category_word in categories_sorted %}
22
15
  <a href="{{ category_word | slugify | prepend: path_type | prepend: site.category_archive.path | relative_url }}" class="page__taxonomy-item" rel="tag">{{ category_word }}</a>{% unless forloop.last %}<span class="sep">, </span>{% endunless %}
23
16
  {% endfor %}
24
17
  </span>
@@ -1,17 +1,11 @@
1
1
  {% assign entries = site[include.collection] %}
2
2
 
3
- {% if include.sort_by == 'title' %}
4
- {% if include.sort_order == 'reverse' %}
5
- {% assign entries = entries | sort: 'title' | reverse %}
6
- {% else %}
7
- {% assign entries = entries | sort: 'title' %}
8
- {% endif %}
9
- {% elsif include.sort_by == 'date' %}
10
- {% if include.sort_order == 'reverse' %}
11
- {% assign entries = entries | sort: 'date' | reverse %}
12
- {% else %}
13
- {% assign entries = entries | sort: 'date' %}
14
- {% endif %}
3
+ {% if include.sort_by %}
4
+ {% assign entries = entries | sort: include.sort_by %}
5
+ {% endif %}
6
+
7
+ {% if include.sort_order == 'reverse' %}
8
+ {% assign entries = entries | reverse %}
15
9
  {% endif %}
16
10
 
17
11
  {%- for post in entries -%}
data/_includes/figure CHANGED
@@ -1,9 +1,9 @@
1
1
  <figure class="{{ include.class }}">
2
2
  <img src="{{ include.image_path | relative_url }}"
3
3
  alt="{% if include.alt %}{{ include.alt }}{% endif %}">
4
- {% if include.caption %}
4
+ {%- if include.caption -%}
5
5
  <figcaption>
6
6
  {{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}
7
7
  </figcaption>
8
- {% endif %}
8
+ {%- endif -%}
9
9
  </figure>
@@ -12,7 +12,9 @@
12
12
  {% endfor %}
13
13
  {% endif %}
14
14
 
15
- <li><a href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].feed_label | default: "Feed" }}</a></li>
15
+ {% unless site.atom_feed.hide %}
16
+ <li><a href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].feed_label | default: "Feed" }}</a></li>
17
+ {% endunless %}
16
18
  </ul>
17
19
  </div>
18
20
 
data/_includes/head.html CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  {% include seo.html %}
4
4
 
5
- <link href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ site.title }} Feed">
5
+ {% unless site.atom_feed.hide %}
6
+ <link href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ site.title }} Feed">
7
+ {% endunless %}
6
8
 
7
9
  <!-- https://t.co/dKP3o1e -->
8
10
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -13,6 +15,7 @@
13
15
 
14
16
  <!-- For all browsers -->
15
17
  <link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
18
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css">
16
19
 
17
20
  <!--[if IE]>
18
21
  <style>
@@ -33,4 +36,4 @@
33
36
  {% for script in site.head_scripts %}
34
37
  <script src="{{ script | relative_url }}"></script>
35
38
  {% endfor %}
36
- {% endif %}
39
+ {% endif %}
@@ -1,9 +1,13 @@
1
1
  {% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %}
2
2
 
3
- {% if page.header.overlay_filter contains "rgba" %}
3
+ {% if page.header.overlay_filter contains "gradient" %}
4
4
  {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %}
5
+ {% elsif page.header.overlay_filter contains "rgba" %}
6
+ {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %}
7
+ {% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %}
5
8
  {% elsif page.header.overlay_filter %}
6
9
  {% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %}
10
+ {% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %}
7
11
  {% endif %}
8
12
 
9
13
  {% if page.header.image_description %}
@@ -15,7 +19,7 @@
15
19
  {% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %}
16
20
 
17
21
  <div class="page__hero{% if page.header.overlay_color or page.header.overlay_image %}--overlay{% endif %}"
18
- style="{% if page.header.overlay_color %}background-color: {{ page.header.overlay_color | default: 'transparent' }};{% endif %} {% if overlay_img_path %}background-image: {% if overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}), {% endif %}url('{{ overlay_img_path }}');{% endif %}"
22
+ style="{% if page.header.overlay_color %}background-color: {{ page.header.overlay_color | default: 'transparent' }};{% endif %} {% if overlay_img_path %}background-image: {% if overlay_filter %}{{ overlay_filter }}, {% endif %}url('{{ overlay_img_path }}');{% endif %}"
19
23
  >
20
24
  {% if page.header.overlay_color or page.header.overlay_image %}
21
25
  <div class="wrapper">
@@ -31,9 +35,7 @@
31
35
  {% elsif page.header.show_overlay_excerpt != false and page.excerpt %}
32
36
  <p class="page__lead">{{ page.excerpt | markdownify | remove: "<p>" | remove: "</p>" }}</p>
33
37
  {% endif %}
34
- {% if page.read_time %}
35
- <p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i> {% include read-time.html %}</p>
36
- {% endif %}
38
+ {% include page__meta.html %}
37
39
  {% if page.header.cta_url %}
38
40
  <p><a href="{{ page.header.cta_url | relative_url }}" class="btn btn--light-outline btn--large">{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}</a></p>
39
41
  {% endif %}
@@ -1,4 +1,2 @@
1
- {% capture video_id %}{{ page.header.video.id }}{% endcapture %}
2
- {% capture video_provider %}{{ page.header.video.provider }}{% endcapture %}
3
-
4
- {% include video id=video_id provider=video_provider %}
1
+ {% assign video = page.header.video %}
2
+ {% include video id=video.id provider=video.provider danmaku=video.danmaku %}
@@ -0,0 +1,30 @@
1
+ {% assign document = post | default: page %}
2
+ {% if document.read_time or document.show_date %}
3
+ <p class="page__meta">
4
+ {% if document.show_date and document.date %}
5
+ {% assign date = document.date %}
6
+ <span class="page__meta-date">
7
+ <i class="far {% if include.type == 'grid' and document.read_time and document.show_date %}fa-fw {% endif %}fa-calendar-alt" aria-hidden="true"></i>
8
+ <time datetime="{{ date | date_to_xmlschema }}">{{ date | date: "%B %-d, %Y" }}</time>
9
+ </span>
10
+ {% endif %}
11
+
12
+ {% if document.read_time and document.show_date %}<span class="page__meta-sep"></span>{% endif %}
13
+
14
+ {% if document.read_time %}
15
+ {% assign words_per_minute = document.words_per_minute | default: site.words_per_minute | default: 200 %}
16
+ {% assign words = document.content | strip_html | number_of_words %}
17
+
18
+ <span class="page__meta-readtime">
19
+ <i class="far {% if include.type == 'grid' and document.read_time and document.show_date %}fa-fw {% endif %}fa-clock" aria-hidden="true"></i>
20
+ {% if words < words_per_minute %}
21
+ {{ site.data.ui-text[site.locale].less_than | default: "less than" }} 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
22
+ {% elsif words == words_per_minute %}
23
+ 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
24
+ {% else %}
25
+ {{ words | divided_by: words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
26
+ {% endif %}
27
+ </span>
28
+ {% endif %}
29
+ </p>
30
+ {% endif %}
@@ -4,7 +4,6 @@
4
4
  {% endfor %}
5
5
  {% else %}
6
6
  <script src="{{ '/assets/js/main.min.js' | relative_url }}"></script>
7
- <script src="https://kit.fontawesome.com/4eee35f757.js"></script>
8
7
  {% endif %}
9
8
 
10
9
  {% if site.search == true or page.layout == "search" %}
@@ -44,11 +44,18 @@ search.addWidget(
44
44
  instantsearch.widgets.hits({
45
45
  container: '.search-hits',
46
46
  templates: {
47
- item: hitTemplate
47
+ item: hitTemplate,
48
+ empty: '{{ site.data.ui-text[site.locale].search_algolia_no_results | default: "No results" }}',
48
49
  }
49
50
  })
50
51
  );
51
52
 
52
- // Starting the search
53
- search.start();
53
+ // Starting the search only when toggle is clicked
54
+ $(document).ready(function () {
55
+ $(".search__toggle").on("click", function() {
56
+ if(!search.started) {
57
+ search.start();
58
+ }
59
+ });
60
+ });
54
61
  </script>
data/_includes/seo.html CHANGED
@@ -52,6 +52,9 @@
52
52
 
53
53
  {% if author.name %}
54
54
  <meta name="author" content="{{ author.name | default: author }}">
55
+ {% if og_type == "article" %}
56
+ <meta property="article:author" content="{{ author.name | default: author }}">
57
+ {% endif %}
55
58
  {% endif %}
56
59
 
57
60
  <meta property="og:type" content="{{ og_type }}">
@@ -6,19 +6,12 @@
6
6
  {% endcase %}
7
7
 
8
8
  {% if site.tag_archive.path %}
9
- {% comment %}
10
- <!-- Sort alphabetically regardless of case e.g. a B c d E -->
11
- <!-- modified from http://www.codeofclimber.ru/2015/sorting-site-tags-in-jekyll/ -->
12
- {% endcomment %}
13
- {% capture page_tags %}{% for tag in page.tags %}{{ tag | downcase }}|{{ tag }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
14
- {% assign tag_hashes = page_tags | split: ',' | sort %}
9
+ {% assign tags_sorted = page.tags | sort_natural %}
15
10
 
16
11
  <p class="page__taxonomy">
17
12
  <strong><i class="fas fa-fw fa-tags" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].tags_label | default: "Tags:" }} </strong>
18
13
  <span itemprop="keywords">
19
- {% for hash in tag_hashes %}
20
- {% assign keyValue = hash | split: '|' %}
21
- {% capture tag_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %}
14
+ {% for tag_word in tags_sorted %}
22
15
  <a href="{{ tag_word | slugify | prepend: path_type | prepend: site.tag_archive.path | relative_url }}" class="page__taxonomy-item" rel="tag">{{ tag_word }}</a>{% unless forloop.last %}<span class="sep">, </span>{% endunless %}
23
16
  {% endfor %}
24
17
  </span>
data/_includes/toc.html CHANGED
@@ -1,6 +1,30 @@
1
1
  {% capture tocWorkspace %}
2
2
  {% comment %}
3
- Version 1.0.8
3
+ Copyright (c) 2017 Vladimir "allejo" Jimenez
4
+
5
+ Permission is hereby granted, free of charge, to any person
6
+ obtaining a copy of this software and associated documentation
7
+ files (the "Software"), to deal in the Software without
8
+ restriction, including without limitation the rights to use,
9
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the
11
+ Software is furnished to do so, subject to the following
12
+ conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
+ OTHER DEALINGS IN THE SOFTWARE.
25
+ {% endcomment %}
26
+ {% comment %}
27
+ Version 1.1.0
4
28
  https://github.com/allejo/jekyll-toc
5
29
 
6
30
  "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
@@ -12,85 +36,147 @@
12
36
  * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
13
37
 
14
38
  Optional Parameters:
15
- * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
16
- * class (string) : '' - a CSS class assigned to the TOC
17
- * id (string) : '' - an ID to assigned to the TOC
18
- * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
19
- * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
20
- * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
21
- * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
22
- * baseurl (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
23
- * anchor_class (string) : '' - add custom class(es) for each anchor element
39
+ * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
40
+ * class (string) : '' - a CSS class assigned to the TOC
41
+ * id (string) : '' - an ID to assigned to the TOC
42
+ * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
43
+ * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
44
+ * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
45
+ * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
46
+ * submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' placeholder which is the current "submenu" heading level
47
+ * base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
48
+ * anchor_class (string) : '' - add custom class(es) for each anchor element
49
+ * skip_no_ids (bool) : false - skip headers that do not have an `id` attribute
24
50
 
25
51
  Output:
26
52
  An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
27
53
  generate the table of contents and will NOT output the markdown given to it
28
54
  {% endcomment %}
29
55
 
30
- {% capture my_toc %}{% endcapture %}
56
+ {% capture newline %}
57
+ {% endcapture %}
58
+ {% assign newline = newline | rstrip %} <!-- Remove the extra spacing but preserve the newline -->
59
+
60
+ {% capture deprecation_warnings %}{% endcapture %}
61
+
62
+ {% if include.baseurl %}
63
+ {% capture deprecation_warnings %}{{ deprecation_warnings }}<!-- jekyll-toc :: "baseurl" has been deprecated, use "base_url" instead -->{{ newline }}{% endcapture %}
64
+ {% endif %}
65
+
66
+ {% if include.skipNoIDs %}
67
+ {% capture deprecation_warnings %}{{ deprecation_warnings }}<!-- jekyll-toc :: "skipNoIDs" has been deprecated, use "skip_no_ids" instead -->{{ newline }}{% endcapture %}
68
+ {% endif %}
69
+
70
+ {% capture jekyll_toc %}{% endcapture %}
31
71
  {% assign orderedList = include.ordered | default: false %}
72
+ {% assign baseURL = include.base_url | default: include.baseurl | default: '' %}
73
+ {% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %}
32
74
  {% assign minHeader = include.h_min | default: 1 %}
33
75
  {% assign maxHeader = include.h_max | default: 6 %}
34
- {% assign nodes = include.html | split: '<h' %}
76
+ {% assign nodes = include.html | strip | split: '<h' %}
77
+
35
78
  {% assign firstHeader = true %}
79
+ {% assign currLevel = 0 %}
80
+ {% assign lastLevel = 0 %}
36
81
 
37
- {% capture listModifier %}{% if orderedList %}1.{% else %}-{% endif %}{% endcapture %}
82
+ {% capture listModifier %}{% if orderedList %}ol{% else %}ul{% endif %}{% endcapture %}
38
83
 
39
84
  {% for node in nodes %}
40
85
  {% if node == "" %}
41
86
  {% continue %}
42
87
  {% endif %}
43
88
 
44
- {% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
89
+ {% assign currLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
45
90
 
46
- {% if headerLevel < minHeader or headerLevel > maxHeader %}
91
+ {% if currLevel < minHeader or currLevel > maxHeader %}
47
92
  {% continue %}
48
93
  {% endif %}
49
94
 
50
- {% if firstHeader %}
51
- {% assign firstHeader = false %}
52
- {% assign minHeader = headerLevel %}
53
- {% endif %}
54
-
55
- {% assign indentAmount = headerLevel | minus: minHeader %}
56
95
  {% assign _workspace = node | split: '</h' %}
57
96
 
58
97
  {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
59
98
  {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
60
- {% assign html_id = _idWorkspace[0] %}
99
+ {% assign htmlID = _idWorkspace[0] %}
61
100
 
62
101
  {% assign _classWorkspace = _workspace[0] | split: 'class="' %}
63
102
  {% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
64
- {% assign html_class = _classWorkspace[0] %}
103
+ {% assign htmlClass = _classWorkspace[0] %}
65
104
 
66
- {% if html_class contains "no_toc" %}
105
+ {% if htmlClass contains "no_toc" %}
67
106
  {% continue %}
68
107
  {% endif %}
69
108
 
109
+ {% if firstHeader %}
110
+ {% assign minHeader = currLevel %}
111
+ {% endif %}
112
+
70
113
  {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
71
114
  {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
72
115
 
73
- {% assign space = '' %}
74
- {% for i in (1..indentAmount) %}
75
- {% assign space = space | prepend: ' ' %}
76
- {% endfor %}
116
+ {% if include.item_class and include.item_class != blank %}
117
+ {% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{% endcapture %}
118
+ {% endif %}
119
+
120
+ {% if include.submenu_class and include.submenu_class != blank %}
121
+ {% assign subMenuLevel = currLevel | minus: 1 %}
122
+ {% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' ' }}"{% endcapture %}
123
+ {% endif %}
77
124
 
78
- {% unless include.item_class == blank %}
79
- {% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
80
- {% endunless %}
125
+ {% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
81
126
 
82
- {% capture heading_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
83
- {% capture my_toc %}{{ my_toc }}
84
- {{ space }}{{ listModifier }} {{ listItemClass }} [{{ heading_body | replace: "|", "\|" }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %}
127
+ {% if htmlID %}
128
+ {% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %}
129
+
130
+ {% if include.anchor_class %}
131
+ {% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{% endcapture %}
132
+ {% endif %}
133
+
134
+ {% capture listItem %}<a{{ anchorAttributes }}>{{ anchorBody }}</a>{% endcapture %}
135
+ {% elsif skipNoIDs == true %}
136
+ {% continue %}
137
+ {% else %}
138
+ {% capture listItem %}{{ anchorBody }}{% endcapture %}
139
+ {% endif %}
140
+
141
+ {% if currLevel > lastLevel %}
142
+ {% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %}
143
+ {% elsif currLevel < lastLevel %}
144
+ {% assign repeatCount = lastLevel | minus: currLevel %}
145
+
146
+ {% for i in (1..repeatCount) %}
147
+ {% capture jekyll_toc %}{{ jekyll_toc }}</li></{{ listModifier }}>{% endcapture %}
148
+ {% endfor %}
149
+
150
+ {% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
151
+ {% else %}
152
+ {% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
153
+ {% endif %}
154
+
155
+ {% capture jekyll_toc %}{{ jekyll_toc }}<li{{ listItemClass }}>{{ listItem }}{% endcapture %}
156
+
157
+ {% assign lastLevel = currLevel %}
158
+ {% assign firstHeader = false %}
85
159
  {% endfor %}
86
160
 
87
- {% if include.class %}
88
- {% capture my_toc %}{:.{{ include.class }}}
89
- {{ my_toc | lstrip }}{% endcapture %}
90
- {% endif %}
161
+ {% assign repeatCount = minHeader | minus: 1 %}
162
+ {% assign repeatCount = lastLevel | minus: repeatCount %}
163
+ {% for i in (1..repeatCount) %}
164
+ {% capture jekyll_toc %}{{ jekyll_toc }}</li></{{ listModifier }}>{% endcapture %}
165
+ {% endfor %}
166
+
167
+ {% if jekyll_toc != '' %}
168
+ {% assign rootAttributes = '' %}
169
+ {% if include.class and include.class != blank %}
170
+ {% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %}
171
+ {% endif %}
172
+
173
+ {% if include.id and include.id != blank %}
174
+ {% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %}
175
+ {% endif %}
91
176
 
92
- {% if include.id %}
93
- {% capture my_toc %}{: #{{ include.id }}}
94
- {{ my_toc | lstrip }}{% endcapture %}
177
+ {% if rootAttributes %}
178
+ {% assign nodes = jekyll_toc | split: '>' %}
179
+ {% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %}
180
+ {% endif %}
95
181
  {% endif %}
96
- {% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
182
+ {% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc }}