minimal-mistakes-jekyll 4.20.1 → 4.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -1
  3. data/README.md +11 -10
  4. data/_data/ui-text.yml +194 -24
  5. data/_includes/archive-single.html +2 -2
  6. data/_includes/category-list.html +2 -9
  7. data/_includes/comments-providers/giscus.html +24 -0
  8. data/_includes/comments-providers/scripts.html +2 -0
  9. data/_includes/comments.html +4 -1
  10. data/_includes/documents-collection.html +6 -12
  11. data/_includes/figure +2 -2
  12. data/_includes/footer.html +3 -1
  13. data/_includes/head.html +5 -17
  14. data/_includes/masthead.html +2 -4
  15. data/_includes/page__date.html +3 -2
  16. data/_includes/page__hero.html +7 -3
  17. data/_includes/page__meta.html +31 -0
  18. data/_includes/seo.html +6 -0
  19. data/_includes/skip-links.html +0 -1
  20. data/_includes/tag-list.html +2 -9
  21. data/_includes/toc.html +128 -42
  22. data/_layouts/categories.html +3 -2
  23. data/_layouts/category.html +3 -2
  24. data/_layouts/collection.html +3 -2
  25. data/_layouts/default.html +2 -2
  26. data/_layouts/posts.html +3 -2
  27. data/_layouts/search.html +2 -2
  28. data/_layouts/single.html +2 -2
  29. data/_layouts/tag.html +3 -2
  30. data/_layouts/tags.html +3 -2
  31. data/_sass/minimal-mistakes.scss +2 -2
  32. data/_sass/minimal-mistakes/_archive.scss +8 -0
  33. data/_sass/minimal-mistakes/_footer.scss +0 -1
  34. data/_sass/minimal-mistakes/_forms.scss +0 -34
  35. data/_sass/minimal-mistakes/_navigation.scss +7 -0
  36. data/_sass/minimal-mistakes/_notices.scss +5 -5
  37. data/_sass/minimal-mistakes/_page.scss +1 -1
  38. data/_sass/minimal-mistakes/_sidebar.scss +0 -1
  39. data/_sass/minimal-mistakes/_variables.scss +4 -0
  40. data/_sass/minimal-mistakes/skins/_aqua.scss +5 -1
  41. data/_sass/minimal-mistakes/skins/_contrast.scss +2 -1
  42. data/_sass/minimal-mistakes/skins/_dark.scss +4 -2
  43. data/_sass/minimal-mistakes/skins/_mint.scss +1 -0
  44. data/_sass/minimal-mistakes/skins/_neon.scss +7 -1
  45. data/_sass/minimal-mistakes/skins/_plum.scss +7 -1
  46. data/_sass/minimal-mistakes/skins/_sunrise.scss +7 -2
  47. data/assets/js/_main.js +2 -2
  48. data/assets/js/lunr/lunr-store.js +2 -2
  49. data/assets/js/lunr/lunr.js +67 -76
  50. data/assets/js/lunr/lunr.min.js +6 -1
  51. data/assets/js/main.min.js +3 -6
  52. data/assets/js/plugins/jquery.greedy-navigation.js +67 -14
  53. data/assets/js/vendor/jquery/{jquery-3.4.1.js → jquery-3.5.1.js} +756 -482
  54. metadata +5 -4
  55. data/_includes/post__meta.html +0 -35
@@ -25,14 +25,15 @@ layout: archive
25
25
  {% endfor %}
26
26
  </ul>
27
27
 
28
+ {% assign entries_layout = page.entries_layout | default: 'list' %}
28
29
  {% for i in (1..categories_max) reversed %}
29
30
  {% for category in site.categories %}
30
31
  {% if category[1].size == i %}
31
32
  <section id="{{ category[0] | slugify | downcase }}" class="taxonomy__section">
32
33
  <h2 class="archive__subtitle">{{ category[0] }}</h2>
33
- <div class="entries-{{ page.entries_layout | default: 'list' }}">
34
+ <div class="entries-{{ entries_layout }}">
34
35
  {% for post in category.last %}
35
- {% include archive-single.html type=page.entries_layout %}
36
+ {% include archive-single.html type=entries_layout %}
36
37
  {% endfor %}
37
38
  </div>
38
39
  <a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
@@ -4,6 +4,7 @@ layout: archive
4
4
 
5
5
  {{ content }}
6
6
 
7
- <div class="entries-{{ page.entries_layout }}">
8
- {% include posts-category.html taxonomy=page.taxonomy type=page.entries_layout %}
7
+ {% assign entries_layout = page.entries_layout | default: 'list' %}
8
+ <div class="entries-{{ entries_layout }}">
9
+ {% include posts-category.html taxonomy=page.taxonomy type=entries_layout %}
9
10
  </div>
@@ -4,6 +4,7 @@ layout: archive
4
4
 
5
5
  {{ content }}
6
6
 
7
- <div class="entries-{{ page.entries_layout }}">
8
- {% include documents-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=page.entries_layout %}
7
+ {% assign entries_layout = page.entries_layout | default: 'list' %}
8
+ <div class="entries-{{ entries_layout }}">
9
+ {% include documents-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=entries_layout %}
9
10
  </div>
@@ -3,8 +3,8 @@
3
3
 
4
4
  <!doctype html>
5
5
  <!--
6
- Minimal Mistakes Jekyll Theme 4.20.1 by Michael Rose
7
- Copyright 2013-2019 Michael Rose - mademistakes.com | @mmistakes
6
+ Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose
7
+ Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes
8
8
  Free for personal and commercial use under the MIT license
9
9
  https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
10
10
  -->
data/_layouts/posts.html CHANGED
@@ -15,13 +15,14 @@ layout: archive
15
15
  {% endfor %}
16
16
  </ul>
17
17
 
18
+ {% assign entries_layout = page.entries_layout | default: 'list' %}
18
19
  {% assign postsByYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
19
20
  {% for year in postsByYear %}
20
21
  <section id="{{ year.name }}" class="taxonomy__section">
21
22
  <h2 class="archive__subtitle">{{ year.name }}</h2>
22
- <div class="entries-{{ page.entries_layout | default: 'list' }}">
23
+ <div class="entries-{{ entries_layout }}">
23
24
  {% for post in year.items %}
24
- {% include archive-single.html type=page.entries_layout %}
25
+ {% include archive-single.html type=entries_layout %}
25
26
  {% endfor %}
26
27
  </div>
27
28
  <a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
data/_layouts/search.html CHANGED
@@ -25,11 +25,11 @@ layout: default
25
25
  {%- assign search_provider = site.search_provider | default: "lunr" -%}
26
26
  {%- case search_provider -%}
27
27
  {%- when "lunr" -%}
28
- <input type="text" id="search" class="search-input" tabindex="-1" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" />
28
+ <input type="text" id="search" class="search-input" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" />
29
29
  <div id="results" class="results"></div>
30
30
  {%- when "google" -%}
31
31
  <form onsubmit="return googleCustomSearchExecute();" id="cse-search-box-form-id">
32
- <input type="text" id="cse-search-input-box-id" class="search-input" tabindex="-1" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" />
32
+ <input type="text" id="cse-search-input-box-id" class="search-input" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" />
33
33
  </form>
34
34
  <div id="results" class="results">
35
35
  <gcse:searchresults-only></gcse:searchresults-only>
data/_layouts/single.html CHANGED
@@ -27,7 +27,7 @@ layout: default
27
27
  {% unless page.header.overlay_color or page.header.overlay_image %}
28
28
  <header>
29
29
  {% if page.title %}<h1 id="page-title" class="page__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>{% endif %}
30
- {% include post__meta.html %}
30
+ {% include page__meta.html %}
31
31
  </header>
32
32
  {% endunless %}
33
33
 
@@ -36,7 +36,7 @@ layout: default
36
36
  <aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
37
37
  <nav class="toc">
38
38
  <header><h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label | default: "On this page" }}</h4></header>
39
- {% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu" %}
39
+ {% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu" skip_no_ids=true %}
40
40
  </nav>
41
41
  </aside>
42
42
  {% endif %}
data/_layouts/tag.html CHANGED
@@ -4,6 +4,7 @@ layout: archive
4
4
 
5
5
  {{ content }}
6
6
 
7
- <div class="entries-{{ page.entries_layout | default: 'list' }}">
8
- {% include posts-tag.html taxonomy=page.taxonomy type=page.entries_layout %}
7
+ {% assign entries_layout = page.entries_layout | default: 'list' %}
8
+ <div class="entries-{{ entries_layout }}">
9
+ {% include posts-tag.html taxonomy=page.taxonomy type=entries_layout %}
9
10
  </div>
data/_layouts/tags.html CHANGED
@@ -25,14 +25,15 @@ layout: archive
25
25
  {% endfor %}
26
26
  </ul>
27
27
 
28
+ {% assign entries_layout = page.entries_layout | default: 'list' %}
28
29
  {% for i in (1..tags_max) reversed %}
29
30
  {% for tag in site.tags %}
30
31
  {% if tag[1].size == i %}
31
32
  <section id="{{ tag[0] | slugify | downcase }}" class="taxonomy__section">
32
33
  <h2 class="archive__subtitle">{{ tag[0] }}</h2>
33
- <div class="entries-{{ page.entries_layout | default: 'list' }}">
34
+ <div class="entries-{{ entries_layout }}">
34
35
  {% for post in tag.last %}
35
- {% include archive-single.html type=page.entries_layout %}
36
+ {% include archive-single.html type=entries_layout %}
36
37
  {% endfor %}
37
38
  </div>
38
39
  <a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Minimal Mistakes Jekyll Theme 4.20.1 by Michael Rose
3
- * Copyright 2013-2019 Michael Rose - mademistakes.com | @mmistakes
2
+ * Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose
3
+ * Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes
4
4
  * Licensed under MIT (https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE)
5
5
  */
6
6
 
@@ -201,6 +201,14 @@
201
201
  font-size: 0.6em;
202
202
  }
203
203
 
204
+ .page__meta-sep {
205
+ display: block;
206
+
207
+ &::before {
208
+ display: none;
209
+ }
210
+ }
211
+
204
212
  .archive__item-title {
205
213
  margin-top: 0.5em;
206
214
  font-size: $type-size-5;
@@ -8,7 +8,6 @@
8
8
  margin-left: 0;
9
9
  margin-right: 0;
10
10
  width: 100%;
11
- clear: both;
12
11
  margin-top: 3em;
13
12
  color: $muted-text-color;
14
13
  -webkit-animation: $intro-transition;
@@ -357,37 +357,3 @@ select:focus {
357
357
  left: 50%;
358
358
  z-index: 11;
359
359
  }
360
-
361
- /*
362
- Google search form
363
- ========================================================================== */
364
-
365
- #goog-fixurl {
366
- ul {
367
- list-style: none;
368
- margin-left: 0;
369
- padding-left: 0;
370
- li {
371
- list-style-type: none;
372
- }
373
- }
374
- }
375
-
376
- #goog-wm-qt {
377
- width: auto;
378
- margin-right: 10px;
379
- margin-bottom: 20px;
380
- padding: 8px 20px;
381
- display: inline-block;
382
- font-size: $type-size-6;
383
- background-color: #fff;
384
- color: #000;
385
- border-width: 2px !important;
386
- border-style: solid !important;
387
- border-color: $border-color;
388
- border-radius: $border-radius;
389
- }
390
-
391
- #goog-wm-sb {
392
- @extend .btn;
393
- }
@@ -184,6 +184,8 @@
184
184
  margin: 0 1rem;
185
185
  color: $masthead-link-color;
186
186
  text-decoration: none;
187
+ -webkit-transition: none;
188
+ transition: none;
187
189
 
188
190
  &:hover {
189
191
  color: $masthead-link-color-hover;
@@ -198,6 +200,11 @@
198
200
  margin-left: 0;
199
201
  }
200
202
  }
203
+
204
+ img{
205
+ -webkit-transition: none;
206
+ transition: none;
207
+ }
201
208
 
202
209
  &__toggle {
203
210
  -ms-flex-item-align: center;
@@ -13,11 +13,11 @@
13
13
  @mixin notice($notice-color) {
14
14
  margin: 2em 0 !important; /* override*/
15
15
  padding: 1em;
16
- color: $dark-gray;
16
+ color: $text-color;
17
17
  font-family: $global-font-family;
18
18
  font-size: $type-size-6 !important;
19
19
  text-indent: initial; /* override*/
20
- background-color: mix(#fff, $notice-color, 90%);
20
+ background-color: mix($background-color, $notice-color, $notice-background-mix);
21
21
  border-radius: $border-radius;
22
22
  box-shadow: 0 1px 1px rgba($notice-color, 0.25);
23
23
 
@@ -46,15 +46,15 @@
46
46
  }
47
47
 
48
48
  a {
49
- color: $notice-color;
49
+ color: mix(#000, $notice-color, 10%);
50
50
 
51
51
  &:hover {
52
- color: mix(#000, $notice-color, 40%);
52
+ color: mix(#000, $notice-color, 50%);
53
53
  }
54
54
  }
55
55
 
56
56
  code {
57
- background-color: mix(#fff, $notice-color, 95%)
57
+ background-color: mix($background-color, $notice-color, $code-notice-background-mix)
58
58
  }
59
59
 
60
60
  pre code {
@@ -299,7 +299,7 @@ body {
299
299
  text-transform: uppercase;
300
300
  }
301
301
 
302
- .post__meta-sep::before {
302
+ .page__meta-sep::before {
303
303
  content: "\2022";
304
304
  padding-left: 0.5em;
305
305
  padding-right: 0.5em;
@@ -185,7 +185,6 @@
185
185
  vertical-align: middle;
186
186
  font-family: $sans-serif;
187
187
  z-index: 20;
188
- position: relative;
189
188
  cursor: pointer;
190
189
 
191
190
  li:last-child {
@@ -118,6 +118,10 @@ $masthead-link-color: $primary-color !default;
118
118
  $masthead-link-color-hover: mix(#000, $primary-color, 25%) !default;
119
119
  $navicon-link-color-hover: mix(#fff, $primary-color, 75%) !default;
120
120
 
121
+ /* notices */
122
+ $notice-background-mix: 80% !default;
123
+ $code-notice-background-mix: 90% !default;
124
+
121
125
  /* syntax highlighting (base16) */
122
126
  $base00: #263238 !default;
123
127
  $base01: #2e3c43 !default;
@@ -27,4 +27,8 @@ $link-color : $info-color !default;
27
27
  $link-color-hover : mix(#000, $link-color, 25%) !default;
28
28
  $link-color-visited : mix(#fff, $link-color, 25%) !default;
29
29
  $masthead-link-color : $primary-color !default;
30
- $masthead-link-color-hover : mix(#000, $primary-color, 25%) !default;
30
+ $masthead-link-color-hover : mix(#000, $primary-color, 25%) !default;
31
+
32
+ /* notices */
33
+ $notice-background-mix: 90% !default;
34
+ $code-notice-background-mix: 95% !default;
@@ -46,6 +46,7 @@ $base0f: #b18a3d !default;
46
46
  color: #fff !important; // override
47
47
  }
48
48
 
49
- .page__footer-follow .social-icons .svg-inline--fa {
49
+ .page__footer-follow .social-icons i,
50
+ .page__footer-follow .social-icons .svg-inline--fa {
50
51
  color: inherit;
51
52
  }
@@ -18,11 +18,13 @@ $masthead-link-color: $text-color !default;
18
18
  $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
19
19
  $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
20
20
 
21
+ .author__urls.social-icons i,
21
22
  .author__urls.social-icons .svg-inline--fa,
22
- .page__footer-follow .social-icons .svg-inline--fa {
23
+ .page__footer-follow .social-icons i,
24
+ .page__footer-follow .social-icons .svg-inline--fa {
23
25
  color: inherit;
24
26
  }
25
27
 
26
28
  .ais-search-box .ais-search-box--input {
27
29
  background-color: $form-background-color;
28
- }
30
+ }
@@ -18,6 +18,7 @@ $navicon-link-color-hover: mix(#fff, $text-color, 80%) !default;
18
18
  color: #fff !important; // override
19
19
  }
20
20
 
21
+ .page__footer-follow .social-icons i,
21
22
  .page__footer-follow .social-icons .svg-inline--fa {
22
23
  color: inherit;
23
24
  }
@@ -18,6 +18,10 @@ $masthead-link-color: $text-color !default;
18
18
  $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
19
19
  $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
20
20
 
21
+ /* notices */
22
+ $notice-background-mix: 90% !default;
23
+ $code-notice-background-mix: 95% !default;
24
+
21
25
  /* neon syntax highlighting (base16) */
22
26
  $base00: #ffffff !default;
23
27
  $base01: #e0e0e0 !default;
@@ -36,8 +40,10 @@ $base0d: #3777e6 !default;
36
40
  $base0e: #ad00a1 !default;
37
41
  $base0f: #cc6633 !default;
38
42
 
43
+ .author__urls.social-icons i,
39
44
  .author__urls.social-icons .svg-inline--fa,
40
- .page__footer-follow .social-icons .svg-inline--fa {
45
+ .page__footer-follow .social-icons i,
46
+ .page__footer-follow .social-icons .svg-inline--fa {
41
47
  color: inherit;
42
48
  }
43
49
 
@@ -18,6 +18,10 @@ $masthead-link-color: $text-color !default;
18
18
  $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
19
19
  $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
20
20
 
21
+ /* notices */
22
+ $notice-background-mix: 70% !default;
23
+ $code-notice-background-mix: 80% !default;
24
+
21
25
  /* plum syntax highlighting (base16) */
22
26
  $base00: #ffffff !default;
23
27
  $base01: #e0e0e0 !default;
@@ -36,8 +40,10 @@ $base0d: #3777e6 !default;
36
40
  $base0e: #ad00a1 !default;
37
41
  $base0f: #cc6633 !default;
38
42
 
43
+ .author__urls.social-icons i,
39
44
  .author__urls.social-icons .svg-inline--fa,
40
- .page__footer-follow .social-icons .svg-inline--fa {
45
+ .page__footer-follow .social-icons i,
46
+ .page__footer-follow .social-icons .svg-inline--fa {
41
47
  color: inherit;
42
48
  }
43
49
 
@@ -20,6 +20,9 @@ $masthead-link-color: $text-color !default;
20
20
  $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
21
21
  $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
22
22
 
23
+ /* notices */
24
+ $notice-background-mix: 75% !default;
25
+
23
26
  /* sunrise syntax highlighting (base16) */
24
27
  $base00: #1d1f21 !default;
25
28
  $base01: #282a2e !default;
@@ -38,7 +41,9 @@ $base0d: #81a2be !default;
38
41
  $base0e: #b294bb !default;
39
42
  $base0f: #a3685a !default;
40
43
 
41
- .author__urls.social-icons .fa,
42
- .page__footer-follow .social-icons .svg-inline--fa {
44
+ .author__urls.social-icons i,
45
+ .author__urls.social-icons .svg-inline--fa,
46
+ .page__footer-follow .social-icons i,
47
+ .page__footer-follow .social-icons .svg-inline--fa {
43
48
  color: inherit;
44
49
  }
data/assets/js/_main.js CHANGED
@@ -83,7 +83,7 @@ $(document).ready(function() {
83
83
 
84
84
  // add lightbox class to all image links
85
85
  $(
86
- "a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif']"
86
+ "a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif'],a[href$='.webp']"
87
87
  ).addClass("image-popup");
88
88
 
89
89
  // Magnific-Popup options
@@ -128,7 +128,7 @@ $(document).ready(function() {
128
128
  var anchor = document.createElement("a");
129
129
  anchor.className = 'header-link';
130
130
  anchor.href = '#' + id;
131
- anchor.innerHTML = '<span class=\"sr-only\">Permalink</span><i class=\"fa fa-link\"></i>';
131
+ anchor.innerHTML = '<span class=\"sr-only\">Permalink</span><i class=\"fas fa-link\"></i>';
132
132
  anchor.title = "Permalink";
133
133
  $(this).append(anchor);
134
134
  }
@@ -42,8 +42,8 @@ var store = [
42
42
  {%- endif -%}
43
43
  "categories": {{ doc.categories | jsonify }},
44
44
  "tags": {{ doc.tags | jsonify }},
45
- "url": {{ doc.url | absolute_url | jsonify }},
46
- "teaser": {{ teaser | absolute_url | jsonify }}
45
+ "url": {{ doc.url | relative_url | jsonify }},
46
+ "teaser": {{ teaser | relative_url | jsonify }}
47
47
  }{%- unless forloop.last and l -%},{%- endunless -%}
48
48
  {%- endfor -%}
49
49
  {%- endfor -%}]
@@ -1,6 +1,6 @@
1
1
  /**
2
- * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.5
3
- * Copyright (C) 2018 Oliver Nightingale
2
+ * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
3
+ * Copyright (C) 2020 Oliver Nightingale
4
4
  * @license MIT
5
5
  */
6
6
 
@@ -54,10 +54,10 @@ var lunr = function (config) {
54
54
  return builder.build()
55
55
  }
56
56
 
57
- lunr.version = "2.3.5"
57
+ lunr.version = "2.3.9"
58
58
  /*!
59
59
  * lunr.utils
60
- * Copyright (C) 2018 Oliver Nightingale
60
+ * Copyright (C) 2020 Oliver Nightingale
61
61
  */
62
62
 
63
63
  /**
@@ -177,7 +177,7 @@ lunr.FieldRef.prototype.toString = function () {
177
177
  }
178
178
  /*!
179
179
  * lunr.Set
180
- * Copyright (C) 2018 Oliver Nightingale
180
+ * Copyright (C) 2020 Oliver Nightingale
181
181
  */
182
182
 
183
183
  /**
@@ -211,8 +211,8 @@ lunr.Set.complete = {
211
211
  return other
212
212
  },
213
213
 
214
- union: function (other) {
215
- return other
214
+ union: function () {
215
+ return this
216
216
  },
217
217
 
218
218
  contains: function () {
@@ -389,7 +389,7 @@ lunr.Token.prototype.clone = function (fn) {
389
389
  }
390
390
  /*!
391
391
  * lunr.tokenizer
392
- * Copyright (C) 2018 Oliver Nightingale
392
+ * Copyright (C) 2020 Oliver Nightingale
393
393
  */
394
394
 
395
395
  /**
@@ -424,7 +424,7 @@ lunr.tokenizer = function (obj, metadata) {
424
424
  })
425
425
  }
426
426
 
427
- var str = obj.toString().trim().toLowerCase(),
427
+ var str = obj.toString().toLowerCase(),
428
428
  len = str.length,
429
429
  tokens = []
430
430
 
@@ -465,7 +465,7 @@ lunr.tokenizer = function (obj, metadata) {
465
465
  lunr.tokenizer.separator = /[\s\-]+/
466
466
  /*!
467
467
  * lunr.Pipeline
468
- * Copyright (C) 2018 Oliver Nightingale
468
+ * Copyright (C) 2020 Oliver Nightingale
469
469
  */
470
470
 
471
471
  /**
@@ -509,8 +509,8 @@ lunr.Pipeline.registeredFunctions = Object.create(null)
509
509
  * or mutate (or add) metadata for a given token.
510
510
  *
511
511
  * A pipeline function can indicate that the passed token should be discarded by returning
512
- * null. This token will not be passed to any downstream pipeline functions and will not be
513
- * added to the index.
512
+ * null, undefined or an empty string. This token will not be passed to any downstream pipeline
513
+ * functions and will not be added to the index.
514
514
  *
515
515
  * Multiple tokens can be returned by returning an array of tokens. Each token will be passed
516
516
  * to any downstream pipeline functions and all will returned tokens will be added to the index.
@@ -673,7 +673,7 @@ lunr.Pipeline.prototype.run = function (tokens) {
673
673
  for (var j = 0; j < tokens.length; j++) {
674
674
  var result = fn(tokens[j], j, tokens)
675
675
 
676
- if (result === void 0 || result === '') continue
676
+ if (result === null || result === void 0 || result === '') continue
677
677
 
678
678
  if (Array.isArray(result)) {
679
679
  for (var k = 0; k < result.length; k++) {
@@ -732,7 +732,7 @@ lunr.Pipeline.prototype.toJSON = function () {
732
732
  }
733
733
  /*!
734
734
  * lunr.Vector
735
- * Copyright (C) 2018 Oliver Nightingale
735
+ * Copyright (C) 2020 Oliver Nightingale
736
736
  */
737
737
 
738
738
  /**
@@ -929,7 +929,7 @@ lunr.Vector.prototype.toJSON = function () {
929
929
  /* eslint-disable */
930
930
  /*!
931
931
  * lunr.stemmer
932
- * Copyright (C) 2018 Oliver Nightingale
932
+ * Copyright (C) 2020 Oliver Nightingale
933
933
  * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
934
934
  */
935
935
 
@@ -1151,7 +1151,7 @@ lunr.stemmer = (function(){
1151
1151
  lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer')
1152
1152
  /*!
1153
1153
  * lunr.stopWordFilter
1154
- * Copyright (C) 2018 Oliver Nightingale
1154
+ * Copyright (C) 2020 Oliver Nightingale
1155
1155
  */
1156
1156
 
1157
1157
  /**
@@ -1316,7 +1316,7 @@ lunr.stopWordFilter = lunr.generateStopWordFilter([
1316
1316
  lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')
1317
1317
  /*!
1318
1318
  * lunr.trimmer
1319
- * Copyright (C) 2018 Oliver Nightingale
1319
+ * Copyright (C) 2020 Oliver Nightingale
1320
1320
  */
1321
1321
 
1322
1322
  /**
@@ -1343,7 +1343,7 @@ lunr.trimmer = function (token) {
1343
1343
  lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer')
1344
1344
  /*!
1345
1345
  * lunr.TokenSet
1346
- * Copyright (C) 2018 Oliver Nightingale
1346
+ * Copyright (C) 2020 Oliver Nightingale
1347
1347
  */
1348
1348
 
1349
1349
  /**
@@ -1469,41 +1469,49 @@ lunr.TokenSet.fromFuzzyString = function (str, editDistance) {
1469
1469
  })
1470
1470
  }
1471
1471
 
1472
+ if (frame.editsRemaining == 0) {
1473
+ continue
1474
+ }
1475
+
1476
+ // insertion
1477
+ if ("*" in frame.node.edges) {
1478
+ var insertionNode = frame.node.edges["*"]
1479
+ } else {
1480
+ var insertionNode = new lunr.TokenSet
1481
+ frame.node.edges["*"] = insertionNode
1482
+ }
1483
+
1484
+ if (frame.str.length == 0) {
1485
+ insertionNode.final = true
1486
+ }
1487
+
1488
+ stack.push({
1489
+ node: insertionNode,
1490
+ editsRemaining: frame.editsRemaining - 1,
1491
+ str: frame.str
1492
+ })
1493
+
1472
1494
  // deletion
1473
1495
  // can only do a deletion if we have enough edits remaining
1474
1496
  // and if there are characters left to delete in the string
1475
- if (frame.editsRemaining > 0 && frame.str.length > 1) {
1476
- var char = frame.str.charAt(1),
1477
- deletionNode
1478
-
1479
- if (char in frame.node.edges) {
1480
- deletionNode = frame.node.edges[char]
1481
- } else {
1482
- deletionNode = new lunr.TokenSet
1483
- frame.node.edges[char] = deletionNode
1484
- }
1485
-
1486
- if (frame.str.length <= 2) {
1487
- deletionNode.final = true
1488
- } else {
1489
- stack.push({
1490
- node: deletionNode,
1491
- editsRemaining: frame.editsRemaining - 1,
1492
- str: frame.str.slice(2)
1493
- })
1494
- }
1497
+ if (frame.str.length > 1) {
1498
+ stack.push({
1499
+ node: frame.node,
1500
+ editsRemaining: frame.editsRemaining - 1,
1501
+ str: frame.str.slice(1)
1502
+ })
1495
1503
  }
1496
1504
 
1497
1505
  // deletion
1498
1506
  // just removing the last character from the str
1499
- if (frame.editsRemaining > 0 && frame.str.length == 1) {
1507
+ if (frame.str.length == 1) {
1500
1508
  frame.node.final = true
1501
1509
  }
1502
1510
 
1503
1511
  // substitution
1504
1512
  // can only do a substitution if we have enough edits remaining
1505
1513
  // and if there are characters left to substitute
1506
- if (frame.editsRemaining > 0 && frame.str.length >= 1) {
1514
+ if (frame.str.length >= 1) {
1507
1515
  if ("*" in frame.node.edges) {
1508
1516
  var substitutionNode = frame.node.edges["*"]
1509
1517
  } else {
@@ -1513,40 +1521,19 @@ lunr.TokenSet.fromFuzzyString = function (str, editDistance) {
1513
1521
 
1514
1522
  if (frame.str.length == 1) {
1515
1523
  substitutionNode.final = true
1516
- } else {
1517
- stack.push({
1518
- node: substitutionNode,
1519
- editsRemaining: frame.editsRemaining - 1,
1520
- str: frame.str.slice(1)
1521
- })
1522
- }
1523
- }
1524
-
1525
- // insertion
1526
- // can only do insertion if there are edits remaining
1527
- if (frame.editsRemaining > 0) {
1528
- if ("*" in frame.node.edges) {
1529
- var insertionNode = frame.node.edges["*"]
1530
- } else {
1531
- var insertionNode = new lunr.TokenSet
1532
- frame.node.edges["*"] = insertionNode
1533
1524
  }
1534
1525
 
1535
- if (frame.str.length == 0) {
1536
- insertionNode.final = true
1537
- } else {
1538
- stack.push({
1539
- node: insertionNode,
1540
- editsRemaining: frame.editsRemaining - 1,
1541
- str: frame.str
1542
- })
1543
- }
1526
+ stack.push({
1527
+ node: substitutionNode,
1528
+ editsRemaining: frame.editsRemaining - 1,
1529
+ str: frame.str.slice(1)
1530
+ })
1544
1531
  }
1545
1532
 
1546
1533
  // transposition
1547
1534
  // can only do a transposition if there are edits remaining
1548
1535
  // and there are enough characters to transpose
1549
- if (frame.editsRemaining > 0 && frame.str.length > 1) {
1536
+ if (frame.str.length > 1) {
1550
1537
  var charA = frame.str.charAt(0),
1551
1538
  charB = frame.str.charAt(1),
1552
1539
  transposeNode
@@ -1560,13 +1547,13 @@ lunr.TokenSet.fromFuzzyString = function (str, editDistance) {
1560
1547
 
1561
1548
  if (frame.str.length == 1) {
1562
1549
  transposeNode.final = true
1563
- } else {
1564
- stack.push({
1565
- node: transposeNode,
1566
- editsRemaining: frame.editsRemaining - 1,
1567
- str: charA + frame.str.slice(2)
1568
- })
1569
1550
  }
1551
+
1552
+ stack.push({
1553
+ node: transposeNode,
1554
+ editsRemaining: frame.editsRemaining - 1,
1555
+ str: charA + frame.str.slice(2)
1556
+ })
1570
1557
  }
1571
1558
  }
1572
1559
 
@@ -1619,6 +1606,10 @@ lunr.TokenSet.fromString = function (str) {
1619
1606
  * Converts this TokenSet into an array of strings
1620
1607
  * contained within the TokenSet.
1621
1608
  *
1609
+ * This is not intended to be used on a TokenSet that
1610
+ * contains wildcards, in these cases the results are
1611
+ * undefined and are likely to cause an infinite loop.
1612
+ *
1622
1613
  * @returns {string[]}
1623
1614
  */
1624
1615
  lunr.TokenSet.prototype.toArray = function () {
@@ -1836,7 +1827,7 @@ lunr.TokenSet.Builder.prototype.minimize = function (downTo) {
1836
1827
  }
1837
1828
  /*!
1838
1829
  * lunr.Index
1839
- * Copyright (C) 2018 Oliver Nightingale
1830
+ * Copyright (C) 2020 Oliver Nightingale
1840
1831
  */
1841
1832
 
1842
1833
  /**
@@ -2003,7 +1994,7 @@ lunr.Index.prototype.query = function (fn) {
2003
1994
  */
2004
1995
  var clause = query.clauses[i],
2005
1996
  terms = null,
2006
- clauseMatches = lunr.Set.complete
1997
+ clauseMatches = lunr.Set.empty
2007
1998
 
2008
1999
  if (clause.usePipeline) {
2009
2000
  terms = this.pipeline.runString(clause.term, {
@@ -2328,7 +2319,7 @@ lunr.Index.load = function (serializedIndex) {
2328
2319
  }
2329
2320
  /*!
2330
2321
  * lunr.Builder
2331
- * Copyright (C) 2018 Oliver Nightingale
2322
+ * Copyright (C) 2020 Oliver Nightingale
2332
2323
  */
2333
2324
 
2334
2325
  /**