minimal-mistakes-jekyll 4.21.0 → 4.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '00821e6d15afa8f2a54da22790dcc9a40011d669e1262065ec430513428d0918'
4
- data.tar.gz: 772acb10c60ebc5ac68de0d4ca80a9f1dbd951c7d128c6b0ab0243e973948db1
3
+ metadata.gz: dcb91441d6c78d05a6d2fe4bc969589ac27860f0c250a861db7282ce53938673
4
+ data.tar.gz: a36a7cb85c4513fccc6213cd1ee74050750737204ef0c246a9f72dd924558b0a
5
5
  SHA512:
6
- metadata.gz: a91075f9650d2799990946a058b632cc3732270d5989ec24331c41360291c8d1697acad253b8da2abd1868f37e24d15b16a4f0a1f99fefabb4862bbd2fcfc220
7
- data.tar.gz: 12aeb9ad53484e4a85623bb548f7237a77ab07ef2fb52d01ba6b078806e1313783bddc1385763d906c5957e8ec6cfa52c0078892224f212e21978f19cc60732d
6
+ metadata.gz: f3c03b5f6b416ed05f186f7c0df7e19b7abdc6fc319af6eacf831213504b9eccaa4a2adc1cfa4d2340fa6db527fd13b01b9674519c8fbcbff15d042d9b2bac4e
7
+ data.tar.gz: e1159ef35f2d69781e103f9af77ed7f52378a2dcdbfd0cdd3693af7a200ba5fbf6af6b16052afe86e13e1393139b95abb0ddcb8161d62ee82e96af1255c47e63
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## Unreleased
2
+
3
+ ### Bug Fixes
4
+
5
+ - Remove Google Search script from `404.md`. [#2597](https://github.com/mmistakes/minimal-mistakes/issues/2597) [#2737](https://github.com/mmistakes/minimal-mistakes/pull/2737) [#2789](https://github.com/mmistakes/minimal-mistakes/pull/2789)
6
+ - Fix Font Awesome icon color in `contrast`, `dark`, `mint`, `neon`, `plum`, and `sunrise` skins. [#2724](https://github.com/mmistakes/minimal-mistakes/issues/2724)
7
+
8
+ ### Enhancements
9
+
10
+ - Allow custom sorting for collections. [#2723](https://github.com/mmistakes/minimal-mistakes/pull/2723)
11
+ - Use `sort_natural` instead of custom Liquid logic to sort tags and categories. [#2756](https://github.com/mmistakes/minimal-mistakes/pull/2756)
12
+ - Add configuration option to toggle off RSS feed link in `<head>` and site footer. [#2787](https://github.com/mmistakes/minimal-mistakes/pull/2787)
13
+ - Upgrade Lunrjs to 2.3.9 and switch to `relative_url`. [#2805]
14
+ - Adds `.webp` to list of supported image extensions for the image popup lightbox. [#2788](https://github.com/mmistakes/minimal-mistakes/pull/2788)
15
+ - Add Hebrew localized UI text strings. [#2760](https://github.com/mmistakes/minimal-mistakes/pull/2760)
16
+ - Update documentation to include `toc_sticky` parameter's description. [#2741](https://github.com/mmistakes/minimal-mistakes/pull/2741)
17
+ - Update Indonesian localized UI text strings. [#2731](https://github.com/mmistakes/minimal-mistakes/pull/2731)
18
+ - Update remote theme documentation. [#2734](https://github.com/mmistakes/minimal-mistakes/pull/2734)
19
+ - Update allejo/jekyll-toc to v1.1.0, skip headings without an ID. [#2752](https://github.com/mmistakes/minimal-mistakes/pull/2752)
20
+ - Allow custom gradient for page header overlay. [#2806](https://github.com/mmistakes/minimal-mistakes/pull/2806)
21
+
1
22
  ## [4.21.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.21.0)
2
23
 
3
24
  ### Bug Fixes
@@ -5,9 +26,9 @@
5
26
  - Fix greedy navigation by improving reliability of remaining space for visible links. [#2664](https://github.com/mmistakes/minimal-mistakes/issues/2664)
6
27
  - Collapse white-space in `figure` helper to fix issues when used in Markdown ordered and unordered lists. [#2697](https://github.com/mmistakes/minimal-mistakes/pull/2697)
7
28
  - Fix dead link to CI services in documentation. [#2635](https://github.com/mmistakes/minimal-mistakes/issues/2635) [#2692](https://github.com/mmistakes/minimal-mistakes/pull/2692)
8
- - Fix a small type in documentation. [#2718](https://github.com/mmistakes/minimal-mistakes/pull/2718)
29
+ - Fix a small typo in documentation. [#2718](https://github.com/mmistakes/minimal-mistakes/pull/2718)
9
30
 
10
- ## Enhancements
31
+ ### Enhancements
11
32
 
12
33
  - Update jQuery to 3.5.1. [#2713](https://github.com/mmistakes/minimal-mistakes/pull/2713)
13
34
  - Add Indonesian localized UI text strings. [#2725](https://github.com/mmistakes/minimal-mistakes/pull/2725)
data/README.md CHANGED
@@ -116,6 +116,7 @@ To install:
116
116
  source "https://rubygems.org"
117
117
 
118
118
  gem "github-pages", group: :jekyll_plugins
119
+ gem "jekyll-include-cache", group: :jekyll_plugins
119
120
  ```
120
121
 
121
122
  2. Add `jekyll-include-cache` to the `plugins` array of your `_config.yml`.
@@ -126,7 +127,7 @@ To install:
126
127
  bundle
127
128
  ```
128
129
 
129
- 4. Add `remote_theme: "mmistakes/minimal-mistakes@4.21.0"` to your `_config.yml` file. Remove any other `theme:` or `remote_theme:` entry.
130
+ 4. Add `remote_theme: "mmistakes/minimal-mistakes@4.22.0"` to your `_config.yml` file. Remove any other `theme:` or `remote_theme:` entry.
130
131
 
131
132
  **Looking for an example?** Use the [Minimal Mistakes remote theme starter](https://github.com/mmistakes/mm-github-pages-starter/generate) for the quickest method of getting a GitHub Pages hosted site up and running. Generate a new repository from the starter, replace sample content with your own, and configure as needed.
132
133
 
data/_data/ui-text.yml CHANGED
@@ -953,10 +953,10 @@ id: &DEFAULT_ID
953
953
  comment_success_msg : "Terimakasih atas komentar Anda! Komentar akan tampil setelah disetujui."
954
954
  comment_error_msg : "Maaf, ada kesalahan pada komentar Anda. Pastikan seluruh kolom sudah dilengkapi dan coba kembali."
955
955
  loading_label : "Sedang memuat..."
956
- search_label_text : "Masukkan kata kunci percarian..."
957
- search_placeholder_text : "Masukkan kata kunci percarian..."
956
+ search_label_text : "Masukkan kata kunci pencarian..."
957
+ search_placeholder_text : "Masukkan kata kunci pencarian..."
958
958
  search_algolia_no_results : "Tidak ada hasil"
959
- results_found : "Hasil percarian ditemukan"
959
+ results_found : "Hasil pencarian ditemukan"
960
960
  back_to_top : "Kembali ke awal"
961
961
  id-ID:
962
962
  <<: *DEFAULT_ID
@@ -1852,6 +1852,59 @@ no-NB:
1852
1852
  no-NN:
1853
1853
  <<: *DEFAULT_NO
1854
1854
 
1855
+ # Hebrew
1856
+ # -------
1857
+ he: &DEFAULT_HE
1858
+ skip_links : "דלגו על קישור"
1859
+ skip_primary_nav : "דלגו לראשי"
1860
+ skip_content : "דלגו לתוכן"
1861
+ skip_footer : "דלגו לתחתית"
1862
+ page : "דף"
1863
+ pagination_previous : "קודם"
1864
+ pagination_next : "הבא"
1865
+ breadcrumb_home_label : "בית"
1866
+ breadcrumb_separator : "/"
1867
+ menu_label : "סגירה/פתיחה של תפריט"
1868
+ search_label : "סגירה/פתיחה של חיפוש"
1869
+ toc_label : "בדף זה"
1870
+ ext_link_label : "קישור ישיר"
1871
+ less_than : "פחות מ"
1872
+ minute_read : "דקת קריאה"
1873
+ share_on_label : "שתפו ב"
1874
+ meta_label :
1875
+ tags_label : "תגיות:"
1876
+ categories_label : "קטגוריות:"
1877
+ date_label : "מעודכן:"
1878
+ comments_label : "השאירו הערה"
1879
+ comments_title : "הערות"
1880
+ more_label : "קראו עוד"
1881
+ related_label : "אולי יעניין אותך גם"
1882
+ follow_label : "עקבו אחרי"
1883
+ feed_label : "פיד"
1884
+ powered_by : "Powered by"
1885
+ website_label : "אתר"
1886
+ email_label : "אימייל"
1887
+ recent_posts : "פוסטים אחרונים"
1888
+ undefined_wpm : "Undefined parameter words_per_minute at _config.yml"
1889
+ comment_form_info : "האימייל שלך נשמר חסוי. שדות חובה מסומנים"
1890
+ comment_form_comment_label : "הערה"
1891
+ comment_form_md_info : "Markdown is supported."
1892
+ comment_form_name_label : "שם"
1893
+ comment_form_email_label : "כתובת אימייל"
1894
+ comment_form_website_label : "אתר (אפשרות)"
1895
+ comment_btn_submit : "שלחו הערה"
1896
+ comment_btn_submitted : "נשלח"
1897
+ comment_success_msg : "תודה על ההערה שלך! היא תופיע באתר ברגע שתאושר."
1898
+ comment_error_msg : "סליחה, קרתה תקלה בשליחה. אנא וודאו שכל השדות מלאים ונסו שנית."
1899
+ loading_label : "טוען..."
1900
+ search_label_text : "מילות חיפוש..."
1901
+ search_placeholder_text : "מילות חיפוש..."
1902
+ search_algolia_no_results : "אין תוצאות"
1903
+ results_found : "תוצאות נמצאו"
1904
+ back_to_top : "חזרה להתחלה"
1905
+ he-IL:
1906
+ <<: *DEFAULT_HE
1907
+
1855
1908
  # Another locale
1856
1909
  # --------------
1857
1910
  #
@@ -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 -%}
@@ -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">
@@ -34,4 +36,4 @@
34
36
  {% for script in site.head_scripts %}
35
37
  <script src="{{ script | relative_url }}"></script>
36
38
  {% endfor %}
37
- {% 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">
@@ -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
@@ -24,7 +24,7 @@
24
24
  OTHER DEALINGS IN THE SOFTWARE.
25
25
  {% endcomment %}
26
26
  {% comment %}
27
- Version 1.0.14
27
+ Version 1.1.0
28
28
  https://github.com/allejo/jekyll-toc
29
29
 
30
30
  "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
@@ -44,34 +44,51 @@
44
44
  * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
45
45
  * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
46
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
- * baseurl (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
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
48
  * anchor_class (string) : '' - add custom class(es) for each anchor element
49
- * skipNoIDs (bool) : false - skip headers that do not have an `id` attribute
49
+ * skip_no_ids (bool) : false - skip headers that do not have an `id` attribute
50
50
 
51
51
  Output:
52
52
  An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
53
53
  generate the table of contents and will NOT output the markdown given to it
54
54
  {% endcomment %}
55
55
 
56
- {% 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 %}
57
71
  {% assign orderedList = include.ordered | default: false %}
58
- {% assign skipNoIDs = include.skipNoIDs | default: false %}
72
+ {% assign baseURL = include.base_url | default: include.baseurl | default: '' %}
73
+ {% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %}
59
74
  {% assign minHeader = include.h_min | default: 1 %}
60
75
  {% assign maxHeader = include.h_max | default: 6 %}
61
- {% assign nodes = include.html | split: '<h' %}
76
+ {% assign nodes = include.html | strip | split: '<h' %}
77
+
62
78
  {% assign firstHeader = true %}
63
- {% assign previousLevel = 0 %}
79
+ {% assign currLevel = 0 %}
80
+ {% assign lastLevel = 0 %}
64
81
 
65
- {% capture listModifier %}{% if orderedList %}1.{% else %}-{% endif %}{% endcapture %}
82
+ {% capture listModifier %}{% if orderedList %}ol{% else %}ul{% endif %}{% endcapture %}
66
83
 
67
84
  {% for node in nodes %}
68
85
  {% if node == "" %}
69
86
  {% continue %}
70
87
  {% endif %}
71
88
 
72
- {% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
89
+ {% assign currLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
73
90
 
74
- {% if headerLevel < minHeader or headerLevel > maxHeader %}
91
+ {% if currLevel < minHeader or currLevel > maxHeader %}
75
92
  {% continue %}
76
93
  {% endif %}
77
94
 
@@ -79,92 +96,87 @@
79
96
 
80
97
  {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
81
98
  {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
82
- {% assign html_id = _idWorkspace[0] %}
99
+ {% assign htmlID = _idWorkspace[0] %}
83
100
 
84
101
  {% assign _classWorkspace = _workspace[0] | split: 'class="' %}
85
102
  {% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
86
- {% assign html_class = _classWorkspace[0] %}
103
+ {% assign htmlClass = _classWorkspace[0] %}
87
104
 
88
- {% if html_class contains "no_toc" %}
105
+ {% if htmlClass contains "no_toc" %}
89
106
  {% continue %}
90
107
  {% endif %}
91
108
 
92
109
  {% if firstHeader %}
93
- {% assign firstHeader = false %}
94
- {% assign minHeader = headerLevel %}
110
+ {% assign minHeader = currLevel %}
95
111
  {% endif %}
96
112
 
97
113
  {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
98
114
  {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
99
115
 
100
- {% assign indentAmount = headerLevel | minus: minHeader %}
101
- {% assign space = '' %}
102
- {% for i in (1..indentAmount) %}
103
- {% assign space = space | prepend: ' ' %}
104
- {% endfor %}
105
-
106
116
  {% if include.item_class and include.item_class != blank %}
107
- {% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
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 %}
108
123
  {% endif %}
109
124
 
110
- {% capture anchor_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
111
- {% capture anchor_body %}{{ anchor_body | replace: "|", "\|" }}{% endcapture %}
125
+ {% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
126
+
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 %}
112
133
 
113
- {% if html_id %}
114
- {% capture list_item %}[{{ anchor_body }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% endcapture %}
134
+ {% capture listItem %}<a{{ anchorAttributes }}>{{ anchorBody }}</a>{% endcapture %}
115
135
  {% elsif skipNoIDs == true %}
116
136
  {% continue %}
117
137
  {% else %}
118
- {% capture list_item %}{{ anchor_body }}{% endcapture %}
138
+ {% capture listItem %}{{ anchorBody }}{% endcapture %}
119
139
  {% endif %}
120
140
 
121
- <!--
122
- If we have a submenu class and we're unindenting, then we need to add a "closing" class to this group of bullet
123
- points
124
- -->
125
- {% if include.submenu_class and previousLevel > indentAmount %}
126
- <!--
127
- `space` is the current indentation, so we if want to close off the previous grouping, we need to add one
128
- more level of indentation
129
- -->
130
- {% assign submenuIndentation = space | prepend: ' ' %}
131
-
132
- {% capture my_toc %}{{ my_toc }}
133
- {{ submenuIndentation }}{:.{{ include.submenu_class | replace: '%level%', previousLevel }}}{% endcapture %}
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 %}
134
153
  {% endif %}
135
154
 
136
- {% capture my_toc %}{{ my_toc }}
137
- {{ space }}{{ listModifier }} {{ listItemClass }} {{ list_item }}{% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %}
155
+ {% capture jekyll_toc %}{{ jekyll_toc }}<li{{ listItemClass }}>{{ listItem }}{% endcapture %}
138
156
 
139
- {% assign previousLevel = indentAmount %}
157
+ {% assign lastLevel = currLevel %}
158
+ {% assign firstHeader = false %}
140
159
  {% endfor %}
141
160
 
142
- {% if include.class and include.class != blank %}
143
- {% capture my_toc %}{:.{{ include.class }}}
144
- {{ my_toc | lstrip }}{% endcapture %}
145
- {% 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 %}
146
166
 
147
- {% if include.id %}
148
- {% capture my_toc %}{: #{{ include.id }}}
149
- {{ my_toc | lstrip }}{% endcapture %}
150
- {% endif %}
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 %}
151
172
 
152
- <!--
153
- If we have a submenu class, we need to close off all the remaining list item groups so that submenu classes are
154
- applied correctly to them
155
- -->
156
- {% if include.submenu_class != blank %}
157
- <!-- The last level of indentation that we were at, we need to work backwards from there closing each group -->
158
- {% for i in (1..previousLevel) %}
159
- {% assign lvl = previousLevel | plus: 1 | minus: i %} <!-- Invert the indent level based on `i` -->
160
- {% assign closingSpace = '' %}
161
-
162
- {% for i in (1..lvl) %}
163
- {% assign closingSpace = closingSpace | prepend: ' ' %}
164
- {% endfor %}
173
+ {% if include.id and include.id != blank %}
174
+ {% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %}
175
+ {% endif %}
165
176
 
166
- {% capture my_toc %}{{ my_toc }}
167
- {{ closingSpace }}{:.{{ include.submenu_class | replace: '%level%', lvl }}}{% endcapture %}
168
- {% endfor %}
177
+ {% if rootAttributes %}
178
+ {% assign nodes = jekyll_toc | split: '>' %}
179
+ {% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %}
180
+ {% endif %}
169
181
  {% endif %}
170
- {% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
182
+ {% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc }}