jekyll-theme-so-simple 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/LICENSE +49 -49
  4. data/README.md +15 -2
  5. data/_data/authors.yml +16 -16
  6. data/_data/navigation.yml +16 -14
  7. data/_data/text.yml +36 -36
  8. data/_includes/disqus-comments.html +19 -19
  9. data/_includes/documents-collection.html +19 -19
  10. data/_includes/entry-date.html +6 -6
  11. data/_includes/entry.html +41 -39
  12. data/_includes/footer-custom.html +3 -3
  13. data/_includes/footer.html +24 -24
  14. data/_includes/google-analytics.html +9 -9
  15. data/_includes/head-custom.html +5 -5
  16. data/_includes/head-feed.html +1 -1
  17. data/_includes/head-seo.html +1 -1
  18. data/_includes/head.html +50 -50
  19. data/_includes/lunr-search-scripts.html +106 -106
  20. data/_includes/masthead.html +13 -13
  21. data/_includes/navigation.html +17 -17
  22. data/_includes/page-author.html +37 -37
  23. data/_includes/page-categories.html +14 -14
  24. data/_includes/page-date.html +4 -4
  25. data/_includes/page-image.html +14 -14
  26. data/_includes/page-pagination.html +19 -19
  27. data/_includes/page-tags.html +14 -14
  28. data/_includes/posts-all.html +3 -3
  29. data/_includes/posts-category.html +3 -3
  30. data/_includes/posts-paginated.html +74 -74
  31. data/_includes/posts-tag.html +3 -3
  32. data/_includes/read-time.html +16 -16
  33. data/_includes/responsive-embed +16 -16
  34. data/_includes/scripts.html +1 -3
  35. data/_includes/skip-links.html +8 -8
  36. data/_includes/social-share.html +6 -6
  37. data/_includes/toc +9 -9
  38. data/_layouts/categories.html +48 -48
  39. data/_layouts/category.html +9 -9
  40. data/_layouts/collection.html +9 -9
  41. data/_layouts/default.html +1 -1
  42. data/_layouts/home.html +17 -17
  43. data/_layouts/page.html +30 -30
  44. data/_layouts/post.html +41 -41
  45. data/_layouts/posts.html +29 -29
  46. data/_layouts/search.html +1 -1
  47. data/_layouts/tag.html +9 -9
  48. data/_layouts/tags.html +48 -48
  49. data/_sass/so-simple.scss +1 -1
  50. data/_sass/so-simple/_author.scss +45 -45
  51. data/_sass/so-simple/_base.scss +112 -112
  52. data/_sass/so-simple/_buttons.scss +92 -92
  53. data/_sass/so-simple/_entries.scss +182 -182
  54. data/_sass/so-simple/_functions.scss +4 -4
  55. data/_sass/so-simple/_global.scss +393 -393
  56. data/_sass/so-simple/_icons.scss +43 -43
  57. data/_sass/so-simple/_mixins.scss +5 -5
  58. data/_sass/so-simple/_notices.scss +93 -93
  59. data/_sass/so-simple/_page.scss +287 -282
  60. data/_sass/so-simple/_reset.scss +523 -523
  61. data/_sass/so-simple/_syntax-highlighting.scss +334 -334
  62. data/_sass/so-simple/_tables.scss +34 -34
  63. data/_sass/so-simple/_utilities.scss +7 -7
  64. data/_sass/so-simple/_variables.scss +132 -132
  65. data/_sass/so-simple/functions/_color.scss +21 -21
  66. data/_sass/so-simple/functions/_em.scss +7 -7
  67. data/_sass/so-simple/functions/_fluid-type.scss +33 -33
  68. data/_sass/so-simple/functions/_yiq.scss +38 -38
  69. data/_sass/so-simple/mixins/_clearfix.scss +32 -32
  70. data/_sass/so-simple/mixins/_float.scss +15 -15
  71. data/_sass/so-simple/mixins/_image.scss +38 -38
  72. data/_sass/so-simple/mixins/_lists.scss +9 -9
  73. data/_sass/so-simple/mixins/_text-truncate.scss +10 -10
  74. data/_sass/so-simple/utilities/_accessibility.scss +43 -43
  75. data/_sass/so-simple/utilities/_align.scss +60 -60
  76. data/_sass/so-simple/utilities/_animations.scss +99 -99
  77. data/_sass/so-simple/utilities/_clearfix.scss +7 -7
  78. data/_sass/so-simple/utilities/_float.scss +7 -7
  79. data/_sass/so-simple/utilities/_responsive-embed.scss +66 -66
  80. data/_sass/so-simple/utilities/_text.scss +48 -48
  81. data/_sass/so-simple/vendor/breakpoint/_breakpoint.scss +114 -114
  82. data/_sass/so-simple/vendor/breakpoint/_context.scss +94 -94
  83. data/_sass/so-simple/vendor/breakpoint/_helpers.scss +151 -151
  84. data/_sass/so-simple/vendor/breakpoint/_legacy-settings.scss +49 -49
  85. data/_sass/so-simple/vendor/breakpoint/_no-query.scss +15 -15
  86. data/_sass/so-simple/vendor/breakpoint/_parsers.scss +215 -215
  87. data/_sass/so-simple/vendor/breakpoint/_respond-to.scss +82 -82
  88. data/_sass/so-simple/vendor/breakpoint/_settings.scss +70 -70
  89. data/_sass/so-simple/vendor/breakpoint/parsers/_double.scss +33 -33
  90. data/_sass/so-simple/vendor/breakpoint/parsers/_query.scss +82 -82
  91. data/_sass/so-simple/vendor/breakpoint/parsers/_resolution.scss +31 -31
  92. data/_sass/so-simple/vendor/breakpoint/parsers/_single.scss +26 -26
  93. data/_sass/so-simple/vendor/breakpoint/parsers/_triple.scss +36 -36
  94. data/_sass/so-simple/vendor/breakpoint/parsers/double/_default-pair.scss +21 -21
  95. data/_sass/so-simple/vendor/breakpoint/parsers/double/_default.scss +22 -22
  96. data/_sass/so-simple/vendor/breakpoint/parsers/double/_double-string.scss +21 -21
  97. data/_sass/so-simple/vendor/breakpoint/parsers/resolution/_resolution.scss +60 -60
  98. data/_sass/so-simple/vendor/breakpoint/parsers/single/_default.scss +13 -13
  99. data/_sass/so-simple/vendor/breakpoint/parsers/triple/_default.scss +18 -18
  100. data/_sass/so-simple/vendor/lity/_lity.scss +221 -221
  101. data/assets/css/main.scss +7 -7
  102. data/assets/js/lunr/lunr.da.min.js +17 -17
  103. data/assets/js/lunr/lunr.de.min.js +17 -17
  104. data/assets/js/lunr/lunr.du.min.js +17 -17
  105. data/assets/js/lunr/lunr.es.min.js +17 -17
  106. data/assets/js/lunr/lunr.fi.min.js +17 -17
  107. data/assets/js/lunr/lunr.fr.min.js +17 -17
  108. data/assets/js/lunr/lunr.hu.min.js +17 -17
  109. data/assets/js/lunr/lunr.it.min.js +17 -17
  110. data/assets/js/lunr/lunr.jp.min.js +1 -1
  111. data/assets/js/lunr/lunr.min.js +6 -6
  112. data/assets/js/lunr/lunr.no.min.js +17 -17
  113. data/assets/js/lunr/lunr.pt.min.js +17 -17
  114. data/assets/js/lunr/lunr.ro.min.js +17 -17
  115. data/assets/js/lunr/lunr.ru.min.js +17 -17
  116. data/assets/js/lunr/lunr.sv.min.js +17 -17
  117. data/assets/js/lunr/lunr.tr.min.js +17 -17
  118. data/assets/js/main.js +17 -15
  119. data/assets/js/main.min.js +2 -2
  120. data/assets/js/plugins/jquery.smooth-scroll.js +358 -358
  121. data/assets/js/plugins/jquery.smooth-scroll.min.js +8 -8
  122. data/assets/js/plugins/lity.js +655 -655
  123. data/assets/js/plugins/lity.min.js +4 -4
  124. data/assets/js/plugins/table-of-contents.js +59 -59
  125. data/assets/js/search-data.json +43 -27
  126. metadata +3 -3
@@ -1,3 +1,3 @@
1
- <!-- start custom footer snippets -->
2
-
3
- <!-- end custom footer snippets -->
1
+ <!-- start custom footer snippets -->
2
+
3
+ <!-- end custom footer snippets -->
@@ -1,24 +1,24 @@
1
- <footer id="footer" class="site-footer">
2
- {% include footer-custom.html %}
3
-
4
- {%- if site.footer_links -%}
5
- <div class="social-icons">
6
- {%- for footer_link in site.footer_links -%}
7
- {%- if footer_link.url contains "://" -%}
8
- {%- assign url = footer_link.url -%}
9
- {%- else -%}
10
- {%- assign url = footer_link.url | relative_url -%}
11
- {%- endif -%}
12
- <a class="social-icon" href="{{ url }}"><i class="{{ footer_link.icon | default: 'fas fa-link' }} fa-2x" title="{{ footer_link.title }}"></i></a>
13
- {%- endfor -%}
14
- </div>
15
- {%- endif -%}
16
-
17
- <div class="copyright">
18
- {% if site.copyright %}
19
- {{ site.copyright | markdownify }}
20
- {% else %}
21
- <p>&copy; {{ site.time | date: '%Y' }} {{ site.name | default: site.title }}. {{ site.data.text[site.locale].powered_by | default: "Powered by" }} <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://github.com/mmistakes/so-simple-theme" rel="nofollow">So Simple</a>.</p>
22
- {% endif %}
23
- </div>
24
- </footer>
1
+ <footer id="footer" class="site-footer">
2
+ {% include footer-custom.html %}
3
+
4
+ {%- if site.footer_links -%}
5
+ <div class="social-icons">
6
+ {%- for footer_link in site.footer_links -%}
7
+ {%- if footer_link.url contains "://" -%}
8
+ {%- assign url = footer_link.url -%}
9
+ {%- else -%}
10
+ {%- assign url = footer_link.url | relative_url -%}
11
+ {%- endif -%}
12
+ <a class="social-icon" href="{{ url }}"><i class="{{ footer_link.icon | default: 'fas fa-link' }} fa-2x" title="{{ footer_link.title }}"></i></a>
13
+ {%- endfor -%}
14
+ </div>
15
+ {%- endif -%}
16
+
17
+ <div class="copyright">
18
+ {% if site.copyright %}
19
+ {{ site.copyright | markdownify }}
20
+ {% else %}
21
+ <p>&copy; {{ site.time | date: '%Y' }} {{ site.name | default: site.title }}. {{ site.data.text[site.locale].powered_by | default: "Powered by" }} <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://github.com/mmistakes/so-simple-theme" rel="nofollow">So Simple</a>.</p>
22
+ {% endif %}
23
+ </div>
24
+ </footer>
@@ -1,9 +1,9 @@
1
- <script>
2
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
6
-
7
- ga('create', '{{ site.google_analytics }}', 'auto');
8
- ga('send', 'pageview');
9
- </script>
1
+ <script>
2
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
6
+
7
+ ga('create', '{{ site.google_analytics }}', 'auto');
8
+ ga('send', 'pageview');
9
+ </script>
@@ -1,5 +1,5 @@
1
- <!-- start custom head snippets -->
2
-
3
- <!-- insert favicons. use http://realfavicongenerator.net/ -->
4
-
5
- <!-- end custom head snippets -->
1
+ <!-- start custom head snippets -->
2
+
3
+ <!-- insert favicons. use http://realfavicongenerator.net/ -->
4
+
5
+ <!-- end custom head snippets -->
@@ -1 +1 @@
1
- <link rel="alternate" type="application/atom+xml" title="{{ site.title | escape }}" href="{{ site.feed.path | default: 'feed.xml' | relative_url }}">
1
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title | escape }}" href="{{ site.feed.path | default: 'feed.xml' | relative_url }}">
@@ -1 +1 @@
1
- {% seo %}
1
+ {% seo %}
@@ -1,50 +1,50 @@
1
- <head>
2
- <meta charset="utf-8">
3
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
4
- <meta name="viewport" content="width=device-width, initial-scale=1">
5
- {% if site.owner.google.verify %}<meta name="google-site-verification" content="{{ site.owner.google.verify }}">{% endif %}
6
- {% if site.owner.bing-verify %}<meta name="msvalidate.01" content="{{ site.owner.bing-verify }}">{% endif %}
7
-
8
- {% if site.plugins contains 'jekyll-seo-tag' or site.gems contains 'jekyll-seo-tag' %}
9
- {% comment %}
10
- Add metadata for search engines and social networks if jekyll-seo-tag plugin is enabled
11
- {% endcomment %}
12
- {% include head-seo.html %}
13
- {% else %}
14
- <title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
15
- <meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">
16
- <link rel="canonical" href="{{ page.url | replace:'index.html', '' | absolute_url }}">
17
- {% endif %}
18
-
19
- <script>
20
- /* Cut the mustard */
21
- if ( 'querySelector' in document && 'addEventListener' in window ) {
22
- document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + 'js';
23
- }
24
- </script>
25
-
26
- <link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
27
- {% if site.google_fonts %}
28
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family={%- for font in site.google_fonts -%}{{ font.name | replace: ' ', '+' }}{% if font.weights %}:{% endif %}{{ font.weights | remove: ' ' }}{% if forloop.last != true %}|{% endif %}{%- endfor -%}">
29
- {% endif %}
30
-
31
- {%- if site.plugins contains 'jekyll-feed' or site.gems contains 'jekyll-feed' -%}
32
- {%- comment -%}
33
- Add Atom feed link if jekyll-feed plugin is enabled
34
- {%- endcomment -%}
35
- {% include head-feed.html %}
36
- {%- endif -%}
37
-
38
- {%- if site.head_scripts -%}
39
- {%- for script in site.head_scripts -%}
40
- {%- if script contains "://" -%}
41
- {%- capture script_path %}{{ script }}{% endcapture -%}
42
- {%- else -%}
43
- {%- capture script_path %}{{ script | absolute_url }}{% endcapture -%}
44
- {%- endif -%}
45
- <script src="{{ script_path }}"></script>
46
- {%- endfor -%}
47
- {%- endif -%}
48
-
49
- {% include head-custom.html %}
50
- </head>
1
+ <head>
2
+ <meta charset="utf-8">
3
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
+ {% if site.owner.google.verify %}<meta name="google-site-verification" content="{{ site.owner.google.verify }}">{% endif %}
6
+ {% if site.owner.bing-verify %}<meta name="msvalidate.01" content="{{ site.owner.bing-verify }}">{% endif %}
7
+
8
+ {% if site.plugins contains 'jekyll-seo-tag' or site.gems contains 'jekyll-seo-tag' %}
9
+ {% comment %}
10
+ Add metadata for search engines and social networks if jekyll-seo-tag plugin is enabled
11
+ {% endcomment %}
12
+ {% include head-seo.html %}
13
+ {% else %}
14
+ <title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
15
+ <meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">
16
+ <link rel="canonical" href="{{ page.url | replace:'index.html', '' | absolute_url }}">
17
+ {% endif %}
18
+
19
+ <script>
20
+ /* Cut the mustard */
21
+ if ( 'querySelector' in document && 'addEventListener' in window ) {
22
+ document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + 'js';
23
+ }
24
+ </script>
25
+
26
+ <link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
27
+ {% if site.google_fonts %}
28
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family={%- for font in site.google_fonts -%}{{ font.name | replace: ' ', '+' }}{% if font.weights %}:{% endif %}{{ font.weights | remove: ' ' }}{% if forloop.last != true %}|{% endif %}{%- endfor -%}">
29
+ {% endif %}
30
+
31
+ {%- if site.plugins contains 'jekyll-feed' or site.gems contains 'jekyll-feed' -%}
32
+ {%- comment -%}
33
+ Add Atom feed link if jekyll-feed plugin is enabled
34
+ {%- endcomment -%}
35
+ {% include head-feed.html %}
36
+ {%- endif -%}
37
+
38
+ {%- if site.head_scripts -%}
39
+ {%- for script in site.head_scripts -%}
40
+ {%- if script contains "://" -%}
41
+ {%- capture script_path %}{{ script }}{% endcapture -%}
42
+ {%- else -%}
43
+ {%- capture script_path %}{{ script | absolute_url }}{% endcapture -%}
44
+ {%- endif -%}
45
+ <script src="{{ script_path }}"></script>
46
+ {%- endfor -%}
47
+ {%- endif -%}
48
+
49
+ {% include head-custom.html %}
50
+ </head>
@@ -1,106 +1,106 @@
1
- {%- assign lang = site.locale | slice: 0,2 | default: "en" -%}
2
- {%- case lang -%}
3
- {%- when "da" -%}
4
- {%- assign lang = "da" -%}
5
- {%- when "de" -%}
6
- {%- assign lang = "de" -%}
7
- {%- when "du" -%}
8
- {%- assign lang = "du" -%}
9
- {-% when "es" -%}
10
- {%- assign lang = "es" -%}
11
- {%- when "fi" -%}
12
- {%- assign lang = "fi" -%}
13
- {%- when "fr" -%}
14
- {%- assign lang = "fr" -%}
15
- {%- when "hu" -%}
16
- {%- assign lang = "hu" -%}
17
- {%- when "it" -%}
18
- {%- assign lang = "it" -%}
19
- {%- when "ja" -%}
20
- {%- assign lang = "ja" -%}
21
- {%- when "jp" -%}
22
- {%- assign lang = "jp" -%}
23
- {%- when "no" -%}
24
- {%- assign lang = "no" -%}
25
- {%- when "pt" -%}
26
- {%- assign lang = "pt" -%}
27
- {%- when "ro" -%}
28
- {%- assign lang = "ro" -%}
29
- {%- when "ru" -%}
30
- {%- assign lang = "ru" -%}
31
- {%- when "sv" -%}
32
- {%- assign lang = "sv" -%}
33
- {%- when "tr" -%}
34
- {%- assign lang = "tr" -%}
35
- {%- else -%}
36
- {%- assign lang = "en" -%}
37
- {%- endcase -%}
38
- <script src="{{ '/assets/js/lunr/lunr.min.js' | absolute_url }}"></script>
39
- <script src="{{ '/assets/js/search-data.json' | absolute_url }}"></script>
40
- {%- unless lang == "en" -%}
41
- <script src="{{ '/assets/js/lunr/lunr.stemmer.support.min.js' | absolute_url }}"></script>
42
- <script src="{{ '/assets/js/lunr/lunr.' | append: lang | append: '.min.js' | absolute_url }}"></script>
43
- {%- endunless %}
44
- <script>
45
- var idx = lunr(function () {
46
- {% unless lang == "en" %}
47
- // use the language
48
- this.use(lunr.{{ lang }});
49
- {% endunless %}
50
- // the, the normal lunr index initialization
51
- this.field('title')
52
- this.field('excerpt')
53
- this.field('categories')
54
- this.field('tags')
55
- this.ref('id')
56
-
57
- this.pipeline.remove(lunr.trimmer)
58
-
59
- // add documents to index
60
- for (var item in store) {
61
- this.add({
62
- title: store[item].title,
63
- excerpt: store[item].excerpt,
64
- categories: store[item].categories,
65
- tags: store[item].tags,
66
- id: item
67
- })
68
- }
69
- });
70
-
71
- console.log(jQuery.type(idx));
72
-
73
- $(document).ready(function () {
74
- $('input#search').on('keyup', function () {
75
- var resultdiv = $('#results');
76
- var query = $(this).val().toLowerCase();
77
- var result =
78
- idx.query(function (q) {
79
- query.split(lunr.tokenizer.separator).forEach(function (term) {
80
- q.term(term, { boost: 100 })
81
- if (query.lastIndexOf(" ") != query.length - 1) {
82
- q.term(term, { usePipeline: false, wildcard: lunr.Query.wildcard.TRAILING, boost: 10 })
83
- }
84
- if (term != "") {
85
- q.term(term, { usePipeline: false, editDistance: 1, boost: 1 })
86
- }
87
- })
88
- });
89
- resultdiv.empty();
90
- resultdiv.prepend('<p class="results__found">' + result.length + ' {{ site.data.text[site.locale].results_found | default: "Result(s) found" }}</p>');
91
- for (var item in result) {
92
- var ref = result[item].ref;
93
- var searchitem =
94
- '<article class="entry">' +
95
- '<h3 class="entry-title">' +
96
- '<a href="' + store[ref].url + '">' + store[ref].title + '</a>' +
97
- '</h3>' +
98
- '<div class="entry-excerpt">' +
99
- '<p>' + store[ref].excerpt.split(" ").splice(0, 20).join(" ") + '...</p>' +
100
- '</div>' +
101
- '</article>';
102
- resultdiv.append(searchitem);
103
- }
104
- });
105
- });
106
- </script>
1
+ {%- assign lang = site.locale | slice: 0,2 | default: "en" -%}
2
+ {%- case lang -%}
3
+ {%- when "da" -%}
4
+ {%- assign lang = "da" -%}
5
+ {%- when "de" -%}
6
+ {%- assign lang = "de" -%}
7
+ {%- when "du" -%}
8
+ {%- assign lang = "du" -%}
9
+ {-% when "es" -%}
10
+ {%- assign lang = "es" -%}
11
+ {%- when "fi" -%}
12
+ {%- assign lang = "fi" -%}
13
+ {%- when "fr" -%}
14
+ {%- assign lang = "fr" -%}
15
+ {%- when "hu" -%}
16
+ {%- assign lang = "hu" -%}
17
+ {%- when "it" -%}
18
+ {%- assign lang = "it" -%}
19
+ {%- when "ja" -%}
20
+ {%- assign lang = "ja" -%}
21
+ {%- when "jp" -%}
22
+ {%- assign lang = "jp" -%}
23
+ {%- when "no" -%}
24
+ {%- assign lang = "no" -%}
25
+ {%- when "pt" -%}
26
+ {%- assign lang = "pt" -%}
27
+ {%- when "ro" -%}
28
+ {%- assign lang = "ro" -%}
29
+ {%- when "ru" -%}
30
+ {%- assign lang = "ru" -%}
31
+ {%- when "sv" -%}
32
+ {%- assign lang = "sv" -%}
33
+ {%- when "tr" -%}
34
+ {%- assign lang = "tr" -%}
35
+ {%- else -%}
36
+ {%- assign lang = "en" -%}
37
+ {%- endcase -%}
38
+ <script src="{{ '/assets/js/lunr/lunr.min.js' | absolute_url }}"></script>
39
+ <script src="{{ '/assets/js/search-data.json' | absolute_url }}"></script>
40
+ {%- unless lang == "en" -%}
41
+ <script src="{{ '/assets/js/lunr/lunr.stemmer.support.min.js' | absolute_url }}"></script>
42
+ <script src="{{ '/assets/js/lunr/lunr.' | append: lang | append: '.min.js' | absolute_url }}"></script>
43
+ {%- endunless %}
44
+ <script>
45
+ var idx = lunr(function () {
46
+ {% unless lang == "en" %}
47
+ // use the language
48
+ this.use(lunr.{{ lang }});
49
+ {% endunless %}
50
+ // the, the normal lunr index initialization
51
+ this.field('title')
52
+ this.field('excerpt')
53
+ this.field('categories')
54
+ this.field('tags')
55
+ this.ref('id')
56
+
57
+ this.pipeline.remove(lunr.trimmer)
58
+
59
+ // add documents to index
60
+ for (var item in store) {
61
+ this.add({
62
+ title: store[item].title,
63
+ excerpt: store[item].excerpt,
64
+ categories: store[item].categories,
65
+ tags: store[item].tags,
66
+ id: item
67
+ })
68
+ }
69
+ });
70
+
71
+ console.log(jQuery.type(idx));
72
+
73
+ $(document).ready(function () {
74
+ $('input#search').on('keyup', function () {
75
+ var resultdiv = $('#results');
76
+ var query = $(this).val().toLowerCase();
77
+ var result =
78
+ idx.query(function (q) {
79
+ query.split(lunr.tokenizer.separator).forEach(function (term) {
80
+ q.term(term, { boost: 100 })
81
+ if (query.lastIndexOf(" ") != query.length - 1) {
82
+ q.term(term, { usePipeline: false, wildcard: lunr.Query.wildcard.TRAILING, boost: 10 })
83
+ }
84
+ if (term != "") {
85
+ q.term(term, { usePipeline: false, editDistance: 1, boost: 1 })
86
+ }
87
+ })
88
+ });
89
+ resultdiv.empty();
90
+ resultdiv.prepend('<p class="results__found">' + result.length + ' {{ site.data.text[site.locale].results_found | default: "Result(s) found" }}</p>');
91
+ for (var item in result) {
92
+ var ref = result[item].ref;
93
+ var searchitem =
94
+ '<article class="entry">' +
95
+ '<h3 class="entry-title">' +
96
+ '<a href="' + store[ref].url + '">' + store[ref].title + '</a>' +
97
+ '</h3>' +
98
+ '<div class="entry-excerpt">' +
99
+ '<p>' + store[ref].excerpt.split(" ").splice(0, 20).join(" ") + '...</p>' +
100
+ '</div>' +
101
+ '</article>';
102
+ resultdiv.append(searchitem);
103
+ }
104
+ });
105
+ });
106
+ </script>
@@ -1,13 +1,13 @@
1
- <header class="masthead">
2
- <div class="wrap">
3
- {% if site.logo %}
4
- <a href="{{ '/' | relative_url }}" class="site-logo" rel="home" title="{{ site.title }}">
5
- <img src="{{ site.logo | relative_url }}" class="site-logo-img animated fadeInDown" alt="{{ site.title }}">
6
- </a>
7
- {% endif %}
8
- {% unless page.image.path %}
9
- <h1 class="site-title animated fadeIn"><a href="{{ '/' | relative_url }}">{{ site.title }}</a></h1>
10
- <p class="site-description animated fadeIn" itemprop="description">{{ site.description }}</p>
11
- {% endunless %}
12
- </div>
13
- </header><!-- /.masthead -->
1
+ <header class="masthead">
2
+ <div class="wrap">
3
+ {% if site.logo %}
4
+ <a href="{{ '/' | relative_url }}" class="site-logo" rel="home" title="{{ site.title }}">
5
+ <img src="{{ site.logo | relative_url }}" class="site-logo-img animated fadeInDown" alt="{{ site.title }}">
6
+ </a>
7
+ {% endif %}
8
+ {% unless page.image.path %}
9
+ <h1 class="site-title animated fadeIn"><a href="{{ '/' | relative_url }}">{{ site.title }}</a></h1>
10
+ <p class="site-description animated fadeIn" itemprop="description">{{ site.description }}</p>
11
+ {% endunless %}
12
+ </div>
13
+ </header><!-- /.masthead -->
@@ -1,17 +1,17 @@
1
- {% if site.data.navigation %}
2
- <div class="navigation-wrapper">
3
- <a href="#menu-toggle" id="menu-toggle">{{ site.data.text[site.locale].menu_label | default: 'Menu' }}</a>
4
- <nav id="primary-nav" class="site-nav animated drop">
5
- <ul>
6
- {%- for link in site.data.navigation -%}
7
- {%- if link.url contains '://' -%}
8
- {%- assign url = link.url -%}
9
- {%- else -%}
10
- {%- assign url = link.url | relative_url -%}
11
- {%- endif -%}
12
- <li><a href="{{ url }}">{{ link.title }}</a></li>
13
- {%- endfor -%}
14
- </ul>
15
- </nav>
16
- </div><!-- /.navigation-wrapper -->
17
- {% endif %}
1
+ {% if site.data.navigation %}
2
+ <div class="navigation-wrapper">
3
+ <a href="#menu-toggle" id="menu-toggle">{{ site.data.text[site.locale].menu_label | default: 'Menu' }}</a>
4
+ <nav id="primary-nav" class="site-nav animated drop">
5
+ <ul>
6
+ {%- for link in site.data.navigation -%}
7
+ {%- if link.url contains '://' -%}
8
+ {%- assign url = link.url -%}
9
+ {%- else -%}
10
+ {%- assign url = link.url | relative_url -%}
11
+ {%- endif -%}
12
+ <li><a href="{{ url }}">{{ link.title }}</a></li>
13
+ {%- endfor -%}
14
+ </ul>
15
+ </nav>
16
+ </div><!-- /.navigation-wrapper -->
17
+ {% endif %}