linaro-jekyll-theme 4.1.2 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/_config.yml +26 -11
  3. data/_data/footer.yml +7 -25
  4. data/_data/nav.yml +18 -3
  5. data/_data/picture.yml +12 -0
  6. data/_data/sticky_tab_bar.yml +24 -0
  7. data/_includes/blog/post_search_fess.html +11 -0
  8. data/_includes/components/breadcrumb.html +5 -2
  9. data/_includes/components/cookie_manager.html +2 -2
  10. data/_includes/components/head.html +2 -2
  11. data/_includes/components/jumbotron.html +24 -5
  12. data/_includes/components/sticky_tab_bar.html +76 -0
  13. data/_includes/flow/blocks.html +1 -1
  14. data/_includes/flow/feature_block.html +3 -0
  15. data/_includes/flow/flow_inner.html +1 -1
  16. data/_includes/flow/members.html +26 -0
  17. data/_includes/footer/footer.html +3 -3
  18. data/_includes/nav/nav.html +24 -14
  19. data/_includes/nav/universal_nav.html +3 -2
  20. data/_layouts/documentation.html +19 -0
  21. data/_layouts/flow.html +3 -0
  22. data/_layouts/post.html +21 -8
  23. data/_sass/app/overrides.scss +21 -8
  24. data/_sass/core.scss +2 -0
  25. data/_sass/core/breadcrumb.scss +35 -13
  26. data/_sass/core/carousel-header.scss +53 -61
  27. data/_sass/core/documentation.scss +39 -0
  28. data/_sass/core/flow.scss +103 -83
  29. data/_sass/core/fontello.scss +178 -45
  30. data/_sass/core/navbar.scss +91 -57
  31. data/_sass/core/sticky_tab_bar.scss +35 -0
  32. data/_sass/core/theme.scss +75 -46
  33. data/assets/fonts/fontello/fontello.eot +0 -0
  34. data/assets/fonts/fontello/fontello.svg +34 -0
  35. data/assets/fonts/fontello/fontello.ttf +0 -0
  36. data/assets/fonts/fontello/fontello.woff +0 -0
  37. data/assets/fonts/fontello/fontello.woff2 +0 -0
  38. data/assets/images/breadcrumb-banner.png +0 -0
  39. data/assets/js/app/main.js +147 -22
  40. metadata +26 -20
  41. data/_includes/flow/members-section.html +0 -24
  42. data/_includes/sticky-tab-bar.html +0 -61
@@ -204,13 +204,30 @@ $(document).ready(function () {
204
204
  $(window).scroll(function () {
205
205
  navbar();
206
206
  });
207
-
208
- // Multi-level dropdowns
209
- $(".navbar .dropdown-menu > li:not(.dropdown-item)").on("click", function (
210
- e
211
- ) {
212
- e.stopPropagation();
213
- });
207
+ // Sticky tab bar setup
208
+ if ($("#tabbed-nav-bar").length > 0) {
209
+ var text = $("#tabbed-nav-bar ul li a.active").text();
210
+ $("#sub-navigation-header").text(text);
211
+ var stickyTabBarOffset = $("#tabbed-nav-bar").offset().top;
212
+ const stickyNav = () => {
213
+ var scroll = $(window).scrollTop();
214
+ if (scroll > stickyTabBarOffset) {
215
+ $("#tabbed-nav-bar").addClass("fixed-top");
216
+ } else {
217
+ $("#tabbed-nav-bar").removeClass("fixed-top");
218
+ }
219
+ };
220
+ $(window).scroll(function () {
221
+ stickyNav();
222
+ });
223
+ }
224
+ // Multi-level dropdowns
225
+ $(".navbar .dropdown-menu > li:not(.dropdown-item)").on(
226
+ "click",
227
+ function (e) {
228
+ e.stopPropagation();
229
+ }
230
+ );
214
231
  $(".navbar .dropdown-item").on("click", function (e) {
215
232
  var $el = $(this).children(".dropdown-toggle");
216
233
  var $parent = $el.offsetParent(".dropdown-menu");
@@ -390,36 +407,144 @@ $(document).ready(function () {
390
407
  $('[data-toggle="tooltip"]').tooltip();
391
408
  });
392
409
 
393
- if ($("#post_search").length > 0) {
394
- var file_path = $("#post_search").data("file-path");
410
+ // SimpleJekyllSearch
411
+ // if ($("#post_search").length > 0) {
412
+ // var file_path = $("#post_search").data("file-path");
413
+
414
+ // $("#results-container").hide();
415
+ // $("#search-input").keyup(function () {
416
+ // if ($("#search-input").val().length == 0) {
417
+ // $("#results-container").fadeOut("fast");
418
+ // $(".close_search").hide();
419
+ // } else {
420
+ // $("#results-container").fadeIn("fast");
421
+ // $(".close_search").show();
422
+ // }
423
+ // });
424
+ // $(".close_search").click(function (e) {
425
+ // e.preventDefault();
426
+ // $("#search-input").val("");
427
+ // $("#results-container").fadeOut("fast");
428
+ // $(".close_search").hide();
429
+ // });
395
430
 
431
+ // console.log(file_path);
432
+ // SimpleJekyllSearch({
433
+ // searchInput: document.getElementById("search-input"),
434
+ // resultsContainer: document.getElementById("results-container"),
435
+ // searchResultTemplate:
436
+ // '<li class="media flex-row"><picture><img class="lazyload mr-3 img-thumbnail suggested_post_thumb search_result_img" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="{image}"></picture><div class="media-body"><a href="{url}"><h5 class="mt-0 mb-1">{title}</h5><em class="suggested_post_date">{date}</em><p>{description}</p></a></div></li>',
437
+ // json: file_path,
438
+ // success: function (data) {
439
+ // console.log(data);
440
+ // },
441
+ // });
442
+ // }
443
+ // Post Search Functionality using the FESS search API.
444
+ if ($("#post_search").length > 0) {
396
445
  $("#results-container").hide();
397
- $("#search-input").keyup(function () {
446
+
447
+ function getSearchResults(
448
+ progress,
449
+ url,
450
+ searchLabel,
451
+ searchVal,
452
+ startPosition,
453
+ limit,
454
+ searchResults = []
455
+ ) {
456
+ return new Promise((resolve, reject) =>
457
+ fetch(url)
458
+ .then((response) => {
459
+ if (response.status !== 200) {
460
+ throw `${response.status}: ${response.statusText}`;
461
+ }
462
+ console.log(searchVal);
463
+ response
464
+ .json()
465
+ .then((data) => {
466
+ console.log(data);
467
+ searchResults = searchResults.concat(data.response.result);
468
+ if (data.response.next_page && searchResults.length < limit) {
469
+ // progress && progress(searchResults);
470
+ startPosition += 10;
471
+ var nextUrl = `https://search.linaro.org/json/?fields.label=${searchLabel}&q=${searchVal}&start=${startPosition}&sort=last_modified.desc`;
472
+ getSearchResults(
473
+ progress,
474
+ nextUrl,
475
+ searchLabel,
476
+ searchVal,
477
+ startPosition,
478
+ limit,
479
+ searchResults
480
+ )
481
+ .then(resolve)
482
+ .catch(reject);
483
+ } else {
484
+ var responseData = {
485
+ results: searchResults.slice(0, limit),
486
+ response: data.response,
487
+ };
488
+ resolve(responseData);
489
+ }
490
+ })
491
+ .catch(reject);
492
+ })
493
+ .catch(reject)
494
+ );
495
+ }
496
+ var timer;
497
+ $("#search-input").keyup(() => {
398
498
  if ($("#search-input").val().length == 0) {
399
499
  $("#results-container").fadeOut("fast");
400
500
  $(".close_search").hide();
401
501
  } else {
402
502
  $("#results-container").fadeIn("fast");
403
503
  $(".close_search").show();
504
+ clearTimeout(timer);
505
+ timer = setTimeout(function () {
506
+ var searchLabel = $("#post_search").data("search-label");
507
+ var searchQuery = $("#search-input").val();
508
+ var searchUrl = `https://search.linaro.org/json/?fields.label=${searchLabel}&q=${searchQuery}&start=0&sort=last_modified.desc`;
509
+ getSearchResults(
510
+ 0,
511
+ searchUrl,
512
+ searchLabel,
513
+ $("#search-input").val(),
514
+ 0,
515
+ 10,
516
+ []
517
+ )
518
+ .then((responseData) => {
519
+ console.log(responseData);
520
+ console.log("Results:", responseData.results);
521
+ console.log("Response:", responseData.response);
522
+ var pageElements = [];
523
+ pageElements += `<li class="text-center">Found ${responseData.response.record_count} results</li>`;
524
+ for (var i = 0; i < responseData.results.length; i++) {
525
+ var formattedDate = new Date(
526
+ responseData.results[i].last_modified
527
+ ).toDateString();
528
+ var contentDigest = responseData.results[i].digest.slice(
529
+ 0,
530
+ 200
531
+ );
532
+ pageElements += `
533
+ <li class="media flex-row"><div class="media-body"><a href="${responseData.results[i].url}"><h5 class="mt-0 mb-1"> ${responseData.results[i].title}</h5><p>${contentDigest}</p></a></div></li>`;
534
+ }
535
+ pageElements += `<li class="text-center"><a href="/search/?q=${searchQuery}">View all search results</a></li>`;
536
+ $("#results-container").html(pageElements);
537
+ })
538
+ .catch(console.error);
539
+ }, 1000);
404
540
  }
405
541
  });
542
+
406
543
  $(".close_search").click(function (e) {
407
544
  e.preventDefault();
408
545
  $("#search-input").val("");
409
546
  $("#results-container").fadeOut("fast");
410
547
  $(".close_search").hide();
411
548
  });
412
-
413
- console.log(file_path);
414
- SimpleJekyllSearch({
415
- searchInput: document.getElementById("search-input"),
416
- resultsContainer: document.getElementById("results-container"),
417
- searchResultTemplate:
418
- '<li class="media flex-row"><picture><img class="lazyload mr-3 img-thumbnail suggested_post_thumb search_result_img" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="{image}"></picture><div class="media-body"><a href="{url}"><h5 class="mt-0 mb-1">{title}</h5><em class="suggested_post_date">{date}</em><p>{description}</p></a></div></li>',
419
- json: file_path,
420
- success: function (data) {
421
- console.log(data);
422
- },
423
- });
424
549
  }
425
550
  });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linaro-jekyll-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kirkby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-02 00:00:00.000000000 Z
11
+ date: 2020-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.2.2
83
+ - !ruby/object:Gem::Dependency
84
+ name: jekyll-toc
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.15.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.15.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: jekyll-feed
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -134,28 +148,14 @@ dependencies:
134
148
  requirements:
135
149
  - - '='
136
150
  - !ruby/object:Gem::Version
137
- version: 2.1.4
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - '='
143
- - !ruby/object:Gem::Version
144
- version: 2.1.4
145
- - !ruby/object:Gem::Dependency
146
- name: rake
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - '='
150
- - !ruby/object:Gem::Version
151
- version: 13.0.1
151
+ version: 1.17.2
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - '='
157
157
  - !ruby/object:Gem::Version
158
- version: 13.0.1
158
+ version: 1.17.2
159
159
  description:
160
160
  email:
161
161
  - kyle.kirkby@linaro.org
@@ -169,6 +169,7 @@ files:
169
169
  - _data/footer.yml
170
170
  - _data/nav.yml
171
171
  - _data/picture.yml
172
+ - _data/sticky_tab_bar.yml
172
173
  - _data/universal_nav.yml
173
174
  - _includes/blog/authors_posts.html
174
175
  - _includes/blog/blog_filler_element.html
@@ -177,6 +178,7 @@ files:
177
178
  - _includes/blog/latest_posts.html
178
179
  - _includes/blog/pagination.html
179
180
  - _includes/blog/post_search.html
181
+ - _includes/blog/post_search_fess.html
180
182
  - _includes/blog/post_series.html
181
183
  - _includes/blog/post_sidebar.html
182
184
  - _includes/blog/read_time.html
@@ -193,6 +195,7 @@ files:
193
195
  - _includes/components/linaro_404.html
194
196
  - _includes/components/schema.html
195
197
  - _includes/components/sidebar.html
198
+ - _includes/components/sticky_tab_bar.html
196
199
  - _includes/examples/custom_include.html
197
200
  - _includes/examples/custom_include_row.html
198
201
  - _includes/flow/blocks.html
@@ -205,7 +208,7 @@ files:
205
208
  - _includes/flow/flow_inner.html
206
209
  - _includes/flow/full_width_row.html
207
210
  - _includes/flow/image.html
208
- - _includes/flow/members-section.html
211
+ - _includes/flow/members.html
209
212
  - _includes/flow/slider.html
210
213
  - _includes/flow/slider_row.html
211
214
  - _includes/flow/tabbed_content.html
@@ -220,11 +223,11 @@ files:
220
223
  - _includes/nav/nav.html
221
224
  - _includes/nav/universal_nav.html
222
225
  - _includes/social_media_icons.html
223
- - _includes/sticky-tab-bar.html
224
226
  - _includes/youtube.html
225
227
  - _layouts/author.html
226
228
  - _layouts/base.html
227
229
  - _layouts/default.html
230
+ - _layouts/documentation.html
228
231
  - _layouts/flow.html
229
232
  - _layouts/page.html
230
233
  - _layouts/post.html
@@ -324,6 +327,7 @@ files:
324
327
  - _sass/core/carousel-styles.scss
325
328
  - _sass/core/carousel.scss
326
329
  - _sass/core/cookies.scss
330
+ - _sass/core/documentation.scss
327
331
  - _sass/core/error.scss
328
332
  - _sass/core/featherlight.scss
329
333
  - _sass/core/flow.scss
@@ -334,6 +338,7 @@ files:
334
338
  - _sass/core/normalize.scss
335
339
  - _sass/core/owl.carousel.min.scss
336
340
  - _sass/core/owl.theme.default.min.scss
341
+ - _sass/core/sticky_tab_bar.scss
337
342
  - _sass/core/syntax.scss
338
343
  - _sass/core/theme.scss
339
344
  - assets/css/main.scss
@@ -352,6 +357,7 @@ files:
352
357
  - assets/images/Linaro-Sprinkle.png
353
358
  - assets/images/Linaro-logo-white.png
354
359
  - assets/images/avatar-placeholder.jpg
360
+ - assets/images/breadcrumb-banner.png
355
361
  - assets/images/breadcrumb-image.jpg
356
362
  - assets/images/clipboard.svg
357
363
  - assets/images/close.png
@@ -1,24 +0,0 @@
1
- {% if include.object.members_content.members_content.source %}
2
- {% assign members = site.data[include.object.members_content.source] %}
3
- {% else %}
4
- {% assign members = include.object.members_content.items %}
5
- {% endif %}
6
- <div class="members_section {% if include.object.style %}{{include.object.style}}{% endif %}">
7
- {% for member in members %}
8
- {% if member.url %}<a href="{{member.url}}">{% endif %}
9
- {% if member.image.path contains "http" %}
10
- <div class="col-xs-6 col-sm-{{include.object.members_content.item_width}}">
11
- <img class="lazyload img-responsive" alt="{{member.image.alt}}"
12
- src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
13
- data-src="{{member.image.path}}"/>
14
- </div>
15
- {% else %}
16
- {% assign image_path = member.image.path %}
17
- {% assign full_path = member.image.path %}
18
- <div class="col-xs-6 col-sm-{{include.object.members_content.item_width}}">
19
- <!--TODO picture-->
20
- </div>
21
- {% endif %}
22
- {% if member.url %}</a>{% endif %}
23
- {% endfor %}
24
- </div>
@@ -1,61 +0,0 @@
1
- {% if page.sticky-tab-bar %}
2
- {% assign tab-list = page.sticky-tab-bar %}
3
- {% else %}
4
- {% assign sub-nav-tabs = site.data.sticky-tab-bar.pages %}
5
- {% endif %}
6
- {% if sub-nav-tabs %}
7
- {% assign page-base = page.url | split:'/' %}
8
- {% for each in sub-nav-tabs %}
9
- {% for each-url in each.urls %}
10
- {% if each-url == page.url %}
11
- {% if each.list %}
12
- {% assign tab-list = each.list %}
13
- {% endif %}
14
- {% elsif each.sub-pages-enabled %}
15
- {% if page.url contains each-url %}
16
- {% assign tab-list = each.list %}
17
- {% endif %}
18
- {% endif %}
19
- {% endfor %}
20
- {% if each.custom-include %}
21
- {% assign custom-include = each.custom-include %}
22
- {% endif %}
23
- {% endfor %}
24
- {% endif %}
25
- {% if tab-list %}
26
- <div class="tabbed-area non-sticky-nav" id="tabbed-nav-bar"><!-- Nav tabs Wrapper-->
27
- <nav class="navbar-default" role="navigation"><!-- Nav -->
28
- <div class="container">
29
- <div class="navbar-header"><!-- Navbar Header -->
30
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#tabbed-nav-bar-collapse">
31
- <span class="sr-only">Toggle navigation</span>
32
- <span class="icon-bar top-bar"></span>
33
- <span class="icon-bar middle-bar"></span>
34
- <span class="icon-bar bottom-bar"></span>
35
- </button><!-- Navbar Icon Bar Toggle -->
36
- <a class="navbar-brand" id="sub-navigation-header" href=""></a><!-- Navbar Brand -->
37
- </div>
38
- <div class="collapse navbar-collapse" id="tabbed-nav-bar-collapse"><!-- Navbar Collapse -->
39
- <ul class="nav nav-tabs tabbed-nav" id="tab-row" role="tablist">
40
- {% for tab in tab-list %}
41
- <li role="presentation" {% if page.url == tab.url %}
42
- class="active tabbed-nav-btn {% if tab.right %}pull-right{% endif %}"
43
- {% elsif tab.sub-pages and page.url contains tab.url %}
44
- class="active tabbed-nav-btn {% if tab.right %}pull-right{% endif %}"
45
- {% elsif tab.active %}
46
- class="active tabbed-nav-btn {% if tab.right %}pull-right{% endif %}"
47
- {% else %}
48
- class="tabbed-nav-btn {% if tab.right %}pull-right{% endif %}"
49
- {% endif %}>
50
- <a href="{{tab.url}}" aria-controls="overview" role="link">{{tab.title}}</a></li>
51
- {% endfor %}
52
- </ul>
53
- </div>
54
- </div>
55
- </nav>
56
- </div>
57
- {% elsif custom-include %}
58
- {% include {{custom-include}}.html %}
59
- {% else %}
60
- No sticky-nav.yml content found - please add to _data/sticky-tab-bar.yml. More information available <a href="/jekyll/includes/sticky-tab-bar/">here</a>.
61
- {% endif %}