jekyll-theme-open-project 1.1.16 → 1.1.17

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: 0a1320100ae5a96e549bdb9b421a9af5d93dbb67ea5790128c1541a5a41faca8
4
- data.tar.gz: 73c8a7110c32350b2cf31624678403db40dfe56d465d683fed8929168b91502b
3
+ metadata.gz: 985058ab03cdc730f457234ab4c643e7b5c45cfe74fe8653fb9492913bb614e3
4
+ data.tar.gz: b3a54a0c5596163cd28d30f22d4f3101b9593cdbbfb719230b9b9c946d65d931
5
5
  SHA512:
6
- metadata.gz: 5f47aa19b2424cc73734edbab536b2f00c0861522b4240da126a03bf9e102e4c4db43f71a691090bde6a0824fe3d47c038fd95a826744872c91f32e4f16bbbc6
7
- data.tar.gz: fb71ddf8e0e7517c2d4a230c1fec18416ca224c3e122ab91746eaa965254a66b69e2f33d759791a23888154e037d27adf274eec5bbb3821be1448c306e0549d7
6
+ metadata.gz: 77ad5de68ffc78ee735e629f3d269bdd687b0d302d3fd8ed03bf0c916b0885ce07a40dafc7d6db02cc4dedc98e88a0b5753b2772879f21ea06d72f37e278beaf
7
+ data.tar.gz: 77ac7160156d7371abc6d0ba7f9fea277d710f3614ce7b35630b6948f74b6c007a19fec9ff596e9130a30a0e0a2c9a3b02f257eb81629dd2d7a462f5aaef039e
@@ -1,21 +1,21 @@
1
- {% assign software = site.software | where_exp: "item", "item.repo_url != nil" %}
2
- {% assign featured_software = software | where_exp: "item", "item.feature_with_priority != nil" | sort: 'feature_with_priority' %}
3
- {% assign num_software = software | size %}
4
- {% assign num_featured_software = featured_software | size %}
1
+ {% assign software = site.all_software %}
2
+ {% assign featured_software = site.featured_software %}
3
+ {% assign num_software = site.num_all_software %}
4
+ {% assign num_featured_software = site.num_featured_software %}
5
5
  {% if num_featured_software > 0 %}
6
6
  {% assign software = featured_software %}
7
7
  {% endif %}
8
8
 
9
- {% assign specs = site.specs | where_exp: "item", "item.source_url != nil" %}
10
- {% assign featured_specs = specs | where_exp: "item", "item.feature_with_priority != nil" | sort: 'feature_with_priority' %}
11
- {% assign num_specs = specs | size %}
12
- {% assign num_featured_specs = featured_specs | size %}
9
+ {% assign specs = site.all_specs %}
10
+ {% assign featured_specs = site.featured_specs %}
11
+ {% assign num_specs = site.num_all_specs %}
12
+ {% assign num_featured_specs = site.num_featured_specs %}
13
13
  {% if num_featured_specs > 0 %}
14
14
  {% assign specs = featured_specs %}
15
15
  {% endif %}
16
16
 
17
- {% assign posts = site.posts %}
18
- {% assign num_posts = site.posts | size %}
17
+ {% assign posts = site.posts_combined %}
18
+ {% assign num_posts = site.num_posts_combined %}
19
19
 
20
20
  {% assign num_top_items = num_software + num_posts %}
21
21
 
@@ -31,7 +31,7 @@
31
31
  <h2 class="title">Open Source Software</h2>
32
32
 
33
33
  <div class="items">
34
- {% for item in software | limit: site.num_featured_software %}
34
+ {% for item in software | limit: site.max_featured_software %}
35
35
  <a class="item" href="{{ item.url }}" role="article">
36
36
  <div class="logo-container">
37
37
  {% include software-symbol.html item_id=item.id %}
@@ -57,6 +57,12 @@
57
57
  </a>
58
58
  {% endfor %}
59
59
  </div>
60
+
61
+ {% if num_featured_software < num_software %}
62
+ <footer>
63
+ <a class="more-link" href="/software/">See all {{ site.title }} software</a>
64
+ </footer>
65
+ {% endif %}
60
66
  </section>
61
67
  {% endif %}
62
68
 
@@ -65,7 +71,7 @@
65
71
  <h2 class="title">From the Blog</h2>
66
72
 
67
73
  <div class="items">
68
- {% for item in posts | limit: site.num_featured_posts %}
74
+ {% for item in posts | limit: site.max_featured_posts %}
69
75
  {% include post-card.html post=item %}
70
76
  {% endfor %}
71
77
  </div>
@@ -78,7 +84,7 @@
78
84
  <h2 class="title">Open Specifications</h2>
79
85
 
80
86
  <div class="items">
81
- {% for item in specs | limit: site.num_featured_specs %}
87
+ {% for item in specs | limit: site.max_featured_specs %}
82
88
  <a class="item" href="{{ item.url }}" role="article">
83
89
  <header>
84
90
  <h3 class="title">{{ item.title }}</h3>
@@ -100,5 +106,11 @@
100
106
  </a>
101
107
  {% endfor %}
102
108
  </div>
109
+
110
+ {% if num_featured_specs < num_specs %}
111
+ <footer>
112
+ <a class="more-link" href="/specs/">See all {{ site.title }} specs</a>
113
+ </footer>
114
+ {% endif %}
103
115
  </section>
104
116
  {% endif %}
@@ -14,7 +14,7 @@
14
14
 
15
15
  {% assign item_data = include.items | where_exp: "item", "item.url == product_base_url" | first %}
16
16
 
17
- <nav class="nav-sidebar">
17
+ <nav class="docs-nav">
18
18
 
19
19
  {% if is_docs_landing == false %}
20
20
  <header class="sidebar-header">
@@ -1,10 +1,10 @@
1
- {% if include.project_data != nil and include.project_name != nil %}
1
+ {% if include.item.project_data != nil and include.item.project_name != nil %}
2
2
  {% if include.item.slug == 'index' %}
3
3
  {% assign item_slug = include.item.id | split: "/" | reverse | slice: 1 | first %}
4
4
  {% else %}
5
5
  {% assign item_slug = include.item.id | split: "/" | reverse | first %}
6
6
  {% endif %}
7
- {% assign product_home_url = include.project_data.home_url | append: include.item_type | append: "/" | append: item_slug | append: "/" %}
7
+ {% assign product_home_url = include.item.project_data.home_url | append: include.item_type | append: "/" | append: item_slug | append: "/" %}
8
8
  {% else %}
9
9
  {% assign product_home_url = include.item.url | relative_url %}
10
10
  {% endif %}
@@ -17,12 +17,12 @@
17
17
  {% endif %}
18
18
 
19
19
  <header>
20
- {% if include.project_data != nil and include.project_name != nil %}
21
- {% assign project_symbol_path = include.project_name | append: "/assets/symbol.svg" %}
20
+ {% if include.item.project_data != nil and include.item.project_name != nil %}
21
+ {% assign project_symbol_path = include.item.project_name | append: "/assets/symbol.svg" %}
22
22
  {% assign relative_symbol_path = "/projects/" | append: project_symbol_path %}
23
23
  <div class="parent-project">
24
24
  <div class="project-logo"><img src="{{ relative_symbol_path }}"></div>
25
- <h4 class="project-title">{{ include.project_data.title }}</h4>
25
+ <h4 class="project-title">{{ include.item.project_data.title }}</h4>
26
26
  </div>
27
27
  {% endif %}
28
28
  <h3 class="title">{{ include.item.title }}</h3>
@@ -5,6 +5,9 @@
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1">
7
7
 
8
+ <link href="{{ "/assets/favicon.png" | relative_url }}" rel="shortcut icon" type="image/x-icon">
9
+ <link href="{{ "/assets/webclip.png" | relative_url }}" rel="apple-touch-icon">
10
+
8
11
  <link id="themeCSS" rel="stylesheet" href="{{ "assets/css/style.css" | relative_url }}">
9
12
  <script defer src="https://pro.fontawesome.com/releases/v5.1.0/js/all.js" integrity="sha384-E5SpgaZcbSJx0Iabb3Jr2AfTRiFnrdOw1mhO19DzzrT9L+wCpDyHUG2q07aQdO6E" crossorigin="anonymous"></script>
10
13
 
@@ -69,7 +72,8 @@
69
72
  </footer>
70
73
  </div>
71
74
 
72
- <script src="{{ "assets/js/menu.js" | relative_url }}"></script>
75
+ <script src="{{ "assets/js/headroom.min.js" | relative_url }}"></script>
76
+ <script src="{{ "assets/js/opf.js" | relative_url }}"></script>
73
77
 
74
78
  {% include scripts.html %}
75
79
  </body>
@@ -6,22 +6,22 @@ layout: default
6
6
  {% include index-page-item-filter.html url_tag_prefix="/software/" items=site.all_software tag=page.tag %}
7
7
  {% endif %}
8
8
 
9
- {% assign items = page.items | default: site.all_software %}
10
-
11
9
  <section class="items">
12
10
  {% if site.is_hub %}
13
11
  {% include assets/symbol.svg %}
14
- {% endif %}
15
-
16
- {% for product in items %}
17
- {% if site.is_hub %}
18
- {% assign project_name = product.url | split: "/" | slice: 2 | first %}
19
- {% assign project_index_path = "_projects/" | append: project_name | append: "/index.md" %}
20
- {% assign project = site.projects | where: "path", project_index_path | first %}
21
-
22
- {% include software-card-hub.html item=product item_type='software' project_name=project_name project_data=project %}
23
- {% else %}
12
+ {% assign items = page.items | default: site.all_software %}
13
+ {% for product in items %}
24
14
  {% include software-card-hub.html item=product item_type='software' %}
15
+ {% endfor %}
16
+ {% else %}
17
+ {% if site.num_featured_software > 0 %}
18
+ {% for product in site.featured_software %}
19
+ {% include software-card-hub.html item=product item_type='software' %}
20
+ {% endfor %}
21
+ <hr>
25
22
  {% endif %}
26
- {% endfor %}
23
+ {% for product in site.non_featured_software %}
24
+ {% include software-card-hub.html item=product item_type='software' %}
25
+ {% endfor %}
26
+ {% endif %}
27
27
  </section>
@@ -7,21 +7,23 @@ layout: default
7
7
  {% endif %}
8
8
 
9
9
  {% assign items = page.items | default: site.all_specs %}
10
+ {% assign num_items = items | size %}
10
11
 
11
- <section class="items">
12
+ <section class="items {% if num_items < 3 %}one-row{% endif %}">
12
13
  {% if site.is_hub %}
13
14
  {% include assets/symbol.svg %}
14
- {% endif %}
15
-
16
- {% for spec in items %}
17
- {% if site.is_hub %}
18
- {% assign project_name = spec.url | split: "/" | slice: 2 | first %}
19
- {% assign project_index_path = "_projects/" | append: project_name | append: "/index.md" %}
20
- {% assign project = site.projects | where: "path", project_index_path | first %}
21
-
22
- {% include software-card-hub.html item=spec item_type='specs' project_name=project_name project_data=project %}
23
- {% else %}
15
+ {% for spec in items %}
24
16
  {% include software-card-hub.html item=spec item_type='specs' %}
17
+ {% endfor %}
18
+ {% else %}
19
+ {% if site.num_featured_specs > 0 %}
20
+ {% for spec in site.featured_specs %}
21
+ {% include software-card-hub.html item=spec item_type='specs' %}
22
+ {% endfor %}
23
+ <hr>
25
24
  {% endif %}
26
- {% endfor %}
25
+ {% for spec in site.non_featured_specs %}
26
+ {% include software-card-hub.html item=spec item_type='specs' %}
27
+ {% endfor %}
28
+ {% endif %}
27
29
  </section>
@@ -0,0 +1,22 @@
1
+ .headroom {
2
+ will-change: transform;
3
+ transition: transform 200ms linear;
4
+ }
5
+ .headroom--pinned {
6
+ transform: translateY(0%);
7
+ }
8
+ .headroom--unpinned {
9
+ transform: translateY(-100%);
10
+ }
11
+
12
+ body.with-headroom {
13
+ &.layout--product {
14
+ .underlay.header {
15
+ position: fixed;
16
+ top: 0;
17
+ left: 0;
18
+ right: 0;
19
+ z-index: 6;
20
+ }
21
+ }
22
+ }
@@ -29,6 +29,7 @@ $bigscreen-breakpoint: 900px + $gutter * 2;
29
29
 
30
30
  @import "open-project-base";
31
31
  @import "open-project-header-footer";
32
+ @import "headroom";
32
33
 
33
34
 
34
35
  main {
@@ -188,10 +189,6 @@ main {
188
189
  @extend .item-grid;
189
190
  @extend .index-item-grid;
190
191
 
191
- .items.one-row {
192
- justify-content: center;
193
- }
194
-
195
192
  .item {
196
193
  @extend .item-card;
197
194
  @extend .post-card;
@@ -213,6 +210,10 @@ main {
213
210
  }
214
211
  }
215
212
  }
213
+
214
+ > .items.one-row {
215
+ justify-content: center;
216
+ }
216
217
  }
217
218
 
218
219
  .layout--post > & {
@@ -438,6 +439,17 @@ main {
438
439
  &.layout--software-index > main,
439
440
  &.layout--spec-index > main {
440
441
  > .items {
442
+ > hr {
443
+ // Separates featured items, listed initially, from the rest
444
+ width: 10em;
445
+ margin: 40px auto;
446
+ border-style: solid;
447
+ border-color: $primary-color;
448
+ background-color: $primary-color;
449
+ color: $primary-color;
450
+ box-shadow: 2px 2px 0 3px $primary-color;
451
+ }
452
+
441
453
  .item {
442
454
  @extend .item-card;
443
455
  @include hoverable-card(2px, 10px, rgba(desaturate($primary-color, 50), 0.08));
@@ -95,6 +95,16 @@ a {
95
95
  > .items {
96
96
  align-self: stretch;
97
97
  }
98
+
99
+ > footer {
100
+ text-align: center;
101
+
102
+ .more-link {
103
+ @include cta-button-mini(white, $primary-color);
104
+ border-radius: 25px;
105
+ border: 1px solid $primary-color;
106
+ }
107
+ }
98
108
  }
99
109
 
100
110
  .with-symbol-background {
@@ -305,12 +315,34 @@ a {
305
315
  @include code-snippet-container();
306
316
  }
307
317
 
318
+ dl {
319
+ dd {
320
+ margin-left: 1.25em;
321
+ }
322
+ }
308
323
  ul, ol {
324
+ padding-left: 1.25em;
325
+
309
326
  li > p:only-child {
310
327
  // Keep list items visually together
311
328
  margin: 0;
312
329
  }
313
330
  }
331
+ blockquote {
332
+ margin-left: 1.25em;
333
+ }
334
+
335
+ @media screen and (min-width: $bigscreen-breakpoint) {
336
+ dl dd {
337
+ margin-left: 2em;
338
+ }
339
+ blockquote {
340
+ margin-left: 2em;
341
+ }
342
+ ul, ol {
343
+ padding-left: 2em;
344
+ }
345
+ }
314
346
 
315
347
  table {
316
348
  $border-color: lighten($main-font-color, 80);
@@ -215,7 +215,7 @@ body > .underlay > header {
215
215
  left: 0;
216
216
  right: 0;
217
217
  transform: translateY(-100%);
218
- transition: transform .2s ease-out;
218
+ transition: transform .8s cubic-bezier(0.23, 1, 0.32, 1);
219
219
 
220
220
  height: 100vh;
221
221
  overflow: hidden;
@@ -54,7 +54,6 @@
54
54
  }
55
55
 
56
56
  @mixin code-snippet() {
57
- white-space: pre-wrap;
58
57
  color: lighten($main-font-color, 24);
59
58
 
60
59
  @include padded-code-snippet();
@@ -71,7 +70,7 @@
71
70
  @mixin cta-button($bgcolor, $color) {
72
71
  font-weight: 800;
73
72
  font-size: 18px;
74
- padding: 12px 18px;
73
+ padding: 12px 22px;
75
74
  display: inline-block;
76
75
 
77
76
  .icon {
@@ -96,6 +95,12 @@
96
95
  }
97
96
  }
98
97
 
98
+ @mixin cta-button-mini($bgcolor, $color) {
99
+ @include cta-button($bgcolor, $color);
100
+ font-size: 14px;
101
+ padding: 6px 16px;
102
+ }
103
+
99
104
  @mixin hoverable-card($base-y, $base-blur, $color) {
100
105
  $hovered-y: $base-y * 2;
101
106
  $hovered-blur: $base-blur * 2;
@@ -175,7 +180,7 @@
175
180
  }
176
181
  }
177
182
 
178
- > .nav-sidebar {
183
+ > .docs-nav {
179
184
  padding-top: 50px;
180
185
 
181
186
  > .sidebar-header, > section {
@@ -258,11 +263,14 @@
258
263
 
259
264
  background: white;
260
265
  z-index: 1;
266
+ overflow-x: hidden;
261
267
 
262
268
  > header {
263
269
  > .title {
264
- display: flex;
265
- flex-flow: row nowrap;
270
+ @media screen and (min-width: $bigscreen-breakpoint) {
271
+ display: flex;
272
+ flex-flow: row nowrap;
273
+ }
266
274
 
267
275
  border-bottom: 2px solid $primary-dark-color;
268
276
  padding-top: 70px;
@@ -305,6 +313,15 @@
305
313
 
306
314
  // Used for tip block labels
307
315
  .admonitionblock {
316
+ overflow-x: scroll;
317
+
318
+ table:first-child {
319
+ margin-top: 0;
320
+ }
321
+ table:last-child {
322
+ margin-bottom: 0;
323
+ }
324
+
308
325
  td.icon {
309
326
  vertical-align: top;
310
327
  padding-left: 0;
@@ -347,7 +364,7 @@
347
364
  }
348
365
  }
349
366
 
350
- > .nav-sidebar {
367
+ > .docs-nav {
351
368
  padding-top: 0;
352
369
  }
353
370
 
@@ -364,7 +381,7 @@
364
381
  @media screen and (min-width: $bigscreen-breakpoint) {
365
382
  flex-flow: row nowrap;
366
383
 
367
- > .nav-sidebar {
384
+ > .docs-nav {
368
385
  flex: 1;
369
386
  flex-grow: 1;
370
387
  padding-top: 70px;
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * headroom.js v0.9.4 - Give your page some headroom. Hide your header until you need it
3
+ * Copyright (c) 2017 Nick Williams - http://wicky.nillia.ms/headroom.js
4
+ * License: MIT
5
+ */
6
+
7
+ !function(a,b){"use strict";"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Headroom=b()}(this,function(){"use strict";function a(a){this.callback=a,this.ticking=!1}function b(a){return a&&"undefined"!=typeof window&&(a===window||a.nodeType)}function c(a){if(arguments.length<=0)throw new Error("Missing arguments in extend function");var d,e,f=a||{};for(e=1;e<arguments.length;e++){var g=arguments[e]||{};for(d in g)"object"!=typeof f[d]||b(f[d])?f[d]=f[d]||g[d]:f[d]=c(f[d],g[d])}return f}function d(a){return a===Object(a)?a:{down:a,up:a}}function e(a,b){b=c(b,e.options),this.lastKnownScrollY=0,this.elem=a,this.tolerance=d(b.tolerance),this.classes=b.classes,this.offset=b.offset,this.scroller=b.scroller,this.initialised=!1,this.onPin=b.onPin,this.onUnpin=b.onUnpin,this.onTop=b.onTop,this.onNotTop=b.onNotTop,this.onBottom=b.onBottom,this.onNotBottom=b.onNotBottom}var f={bind:!!function(){}.bind,classList:"classList"in document.documentElement,rAF:!!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)};return window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,a.prototype={constructor:a,update:function(){this.callback&&this.callback(),this.ticking=!1},requestTick:function(){this.ticking||(requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this))),this.ticking=!0)},handleEvent:function(){this.requestTick()}},e.prototype={constructor:e,init:function(){if(e.cutsTheMustard)return this.debouncer=new a(this.update.bind(this)),this.elem.classList.add(this.classes.initial),setTimeout(this.attachEvent.bind(this),100),this},destroy:function(){var a=this.classes;this.initialised=!1;for(var b in a)a.hasOwnProperty(b)&&this.elem.classList.remove(a[b]);this.scroller.removeEventListener("scroll",this.debouncer,!1)},attachEvent:function(){this.initialised||(this.lastKnownScrollY=this.getScrollY(),this.initialised=!0,this.scroller.addEventListener("scroll",this.debouncer,!1),this.debouncer.handleEvent())},unpin:function(){var a=this.elem.classList,b=this.classes;!a.contains(b.pinned)&&a.contains(b.unpinned)||(a.add(b.unpinned),a.remove(b.pinned),this.onUnpin&&this.onUnpin.call(this))},pin:function(){var a=this.elem.classList,b=this.classes;a.contains(b.unpinned)&&(a.remove(b.unpinned),a.add(b.pinned),this.onPin&&this.onPin.call(this))},top:function(){var a=this.elem.classList,b=this.classes;a.contains(b.top)||(a.add(b.top),a.remove(b.notTop),this.onTop&&this.onTop.call(this))},notTop:function(){var a=this.elem.classList,b=this.classes;a.contains(b.notTop)||(a.add(b.notTop),a.remove(b.top),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){var a=this.elem.classList,b=this.classes;a.contains(b.bottom)||(a.add(b.bottom),a.remove(b.notBottom),this.onBottom&&this.onBottom.call(this))},notBottom:function(){var a=this.elem.classList,b=this.classes;a.contains(b.notBottom)||(a.add(b.notBottom),a.remove(b.bottom),this.onNotBottom&&this.onNotBottom.call(this))},getScrollY:function(){return void 0!==this.scroller.pageYOffset?this.scroller.pageYOffset:void 0!==this.scroller.scrollTop?this.scroller.scrollTop:(document.documentElement||document.body.parentNode||document.body).scrollTop},getViewportHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},getElementPhysicalHeight:function(a){return Math.max(a.offsetHeight,a.clientHeight)},getScrollerPhysicalHeight:function(){return this.scroller===window||this.scroller===document.body?this.getViewportHeight():this.getElementPhysicalHeight(this.scroller)},getDocumentHeight:function(){var a=document.body,b=document.documentElement;return Math.max(a.scrollHeight,b.scrollHeight,a.offsetHeight,b.offsetHeight,a.clientHeight,b.clientHeight)},getElementHeight:function(a){return Math.max(a.scrollHeight,a.offsetHeight,a.clientHeight)},getScrollerHeight:function(){return this.scroller===window||this.scroller===document.body?this.getDocumentHeight():this.getElementHeight(this.scroller)},isOutOfBounds:function(a){var b=a<0,c=a+this.getScrollerPhysicalHeight()>this.getScrollerHeight();return b||c},toleranceExceeded:function(a,b){return Math.abs(a-this.lastKnownScrollY)>=this.tolerance[b]},shouldUnpin:function(a,b){var c=a>this.lastKnownScrollY,d=a>=this.offset;return c&&d&&b},shouldPin:function(a,b){var c=a<this.lastKnownScrollY,d=a<=this.offset;return c&&b||d},update:function(){var a=this.getScrollY(),b=a>this.lastKnownScrollY?"down":"up",c=this.toleranceExceeded(a,b);this.isOutOfBounds(a)||(a<=this.offset?this.top():this.notTop(),a+this.getViewportHeight()>=this.getScrollerHeight()?this.bottom():this.notBottom(),this.shouldUnpin(a,c)?this.unpin():this.shouldPin(a,c)&&this.pin(),this.lastKnownScrollY=a)}},e.options={tolerance:{up:0,down:0},offset:0,scroller:window,classes:{pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},e.cutsTheMustard="undefined"!=typeof f&&f.rAF&&f.bind&&f.classList,e});
data/assets/js/opf.js ADDED
@@ -0,0 +1,217 @@
1
+ (function () {
2
+ 'use strict';
3
+
4
+
5
+ var body = document.querySelector('body');
6
+
7
+
8
+
9
+ /* Topmost hamburger menu */
10
+
11
+ var initCollapsibleMenu = function(triggerEl, menuEl) {
12
+ var hasOpened = false;
13
+
14
+ if (triggerEl != null && menuEl != null) {
15
+ triggerEl.addEventListener('click', function (evt) {
16
+ hasOpened = menuEl.classList.toggle('expanded');
17
+ if (hasOpened) {
18
+ triggerEl.setAttribute('aria-expanded', true);
19
+ menuEl.setAttribute('aria-hidden', false);
20
+ }
21
+ });
22
+ }
23
+
24
+ return {
25
+ hasOpened: function() {
26
+ return hasOpened;
27
+ },
28
+ };
29
+ };
30
+
31
+ var hamburgerMenu = initCollapsibleMenu(
32
+ document.getElementById('hamburgerButton'),
33
+ document.getElementById('hamburgerMenu'));
34
+
35
+
36
+
37
+ /* Collapsible header */
38
+
39
+ var initCollapsibleHeader = function(headerEl, hamburgerMenu) {
40
+ var collapsibleDocsMenu;
41
+ var body = document.querySelector('body');
42
+ var headerElH = headerEl.offsetHeight;
43
+ var isPinned;
44
+
45
+ body.style.paddingTop = '' + headerElH + 'px';
46
+
47
+ var headroom = new Headroom(headerEl, {
48
+ onUnpin: function() {
49
+ if (hamburgerMenu.hasOpened() || (collapsibleDocsMenu && collapsibleDocsMenu.hasOpened())) {
50
+ this.pin();
51
+ } else {
52
+ isPinned = false;
53
+ }
54
+ },
55
+ onPin: function() {
56
+ isPinned = true;
57
+ },
58
+ });
59
+
60
+ headroom.init();
61
+
62
+ body.style.paddingTop = '' + headerElH + 'px';
63
+ body.classList.add('with-headroom');
64
+
65
+ return {
66
+ getHeaderHeight: function () {
67
+ return headerElH;
68
+ },
69
+ assignCollapsibleDocsNav: function (nav) {
70
+ collapsibleDocsMenu = nav;
71
+ },
72
+ isPinned: function () {
73
+ return isPinned;
74
+ },
75
+ }
76
+ };
77
+
78
+ var collapsibleHeader;
79
+
80
+ if (document.querySelector('body.layout--product .documentation:not(.docs-landing)') != null) {
81
+ collapsibleHeader = initCollapsibleHeader(
82
+ document.querySelector('.underlay.header'),
83
+ hamburgerMenu);
84
+ }
85
+
86
+
87
+
88
+ /* Collapsible docs nav */
89
+
90
+ var initCollapsibleDocsNav = function(docsRoot, collapsibleHeader) {
91
+ var article = docsRoot.querySelector('article');
92
+ var articleHeader = article.querySelector('header:first-child');
93
+ var docsNav = docsRoot.querySelector('.docs-nav');
94
+ var docsNavHeader = docsNav.querySelector('.sidebar-header');
95
+ var docsNavHeaderLink = docsNavHeader.querySelector('a');
96
+ var docsNavHeaderH = docsNavHeader.offsetHeight + 20; // 20px is padding, below
97
+ var docsNavH = docsNav.offsetHeight;
98
+ var docsNavSections = docsNav.querySelectorAll('section');
99
+
100
+ // Offet represents the top header height; meaning it is offset
101
+ // of documentation menu from the topmost edge of viewport
102
+ var offset = collapsibleHeader.getHeaderHeight();
103
+
104
+ article.style.paddingTop = '2em';
105
+ docsNav.style.zIndex = '4';
106
+ docsNav.style.position = 'fixed';
107
+ docsNav.style.top = '' + offset + 'px';
108
+ docsNav.style.left = '0';
109
+ docsNav.style.right = '0';
110
+ docsNav.style.paddingTop = '0';
111
+ docsNav.style.paddingLeft = '2em';
112
+ docsNav.style.paddingRight = '2em';
113
+ docsNav.style.transition = 'background 200ms cubic-bezier(0.23, 1, 0.32, 1), transform 200ms linear';
114
+ docsNav.style.background = 'transparent';
115
+ docsNav.style.overflow = 'hidden';
116
+
117
+ docsNavHeader.style.background = 'white';
118
+ docsNavHeader.style.paddingTop = '10px';
119
+ docsNavHeader.style.paddingBottom = '10px';
120
+ docsNavHeader.style.cursor = 'pointer';
121
+
122
+ docsNavHeader.innerHTML = docsNavHeader.innerHTML + ' ▼';
123
+
124
+ docsNavSections.forEach(function (el) {
125
+ el.style.transition = 'opacity .2s cubic-bezier(0.23, 1, 0.32, 1)';
126
+ });
127
+
128
+ // Triggering opening via header link itself
129
+
130
+ var hasOpened = false;
131
+ var closingTransition;
132
+
133
+ var collapse = function (docsNav) {
134
+ hasOpened = false;
135
+ docsNav.style.background = 'transparent';
136
+ docsNavSections.forEach(function (el) {
137
+ el.style.opacity = '0';
138
+ });
139
+
140
+ closingTransition = window.setTimeout(function () {
141
+ docsNav.style.overflowY = 'hidden';
142
+ docsNav.style.height = '' + docsNavHeaderH + 'px';
143
+ docsNav.style.bottom = 'unset';
144
+ docsNav.scrollTop = 0;
145
+ docsNav.style.borderBottom = '1px solid silver';
146
+ }, 2);
147
+ };
148
+ var open = function (docsNav) {
149
+ hasOpened = true;
150
+ window.clearTimeout(closingTransition);
151
+
152
+ docsNav.style.overflowY = 'scroll';
153
+ docsNav.style.height = 'auto';
154
+
155
+ if (collapsibleHeader.isPinned()) {
156
+ docsNav.style.bottom = '0';
157
+ } else {
158
+ docsNav.style.bottom = '-' + offset + 'px';
159
+ }
160
+
161
+ docsNav.style.background = 'white';
162
+ docsNav.style.borderBottom = 'none';
163
+ docsNavSections.forEach(function (el) {
164
+ el.style.opacity = '1';
165
+ });
166
+ };
167
+ var toggle = function () {
168
+ if (hasOpened) { collapse(docsNav); }
169
+ else { open(docsNav); }
170
+ };
171
+ docsNavHeader.addEventListener('click', toggle);
172
+
173
+ collapse(docsNav);
174
+
175
+ // Hiding docs nav
176
+
177
+ // TODO: Replace with moving this to the top
178
+ // in top header’s headroom hook?
179
+ var headroom = new Headroom(docsNavHeader, {
180
+ classes: {
181
+ pinned: 'pinned',
182
+ unpinned: 'unpinned',
183
+ },
184
+ onUnpin: function () {
185
+ if (hasOpened) {
186
+ this.pin();
187
+ } else {
188
+ docsNav.style.transform = 'translateY(-' + offset + 'px)';
189
+ }
190
+ },
191
+ onPin: function () {
192
+ docsNav.style.top = '' + offset + 'px';
193
+ docsNav.style.zIndex = '4';
194
+ docsNav.style.transform = 'translateY(0)';
195
+ docsNav.style.borderBottom = '1px solid silver';
196
+ },
197
+ });
198
+
199
+ headroom.init();
200
+
201
+ return {
202
+ hasOpened: function () {
203
+ return hasOpened;
204
+ },
205
+ }
206
+ };
207
+
208
+ var docsRoot = body.querySelector('body.layout--product .documentation:not(.docs-landing)');
209
+ var collapsibleDocsNav;
210
+
211
+ if (docsRoot !== null) {
212
+ collapsibleDocsNav = initCollapsibleDocsNav(docsRoot, collapsibleHeader);
213
+ collapsibleHeader.assignCollapsibleDocsNav(collapsibleDocsNav);
214
+ }
215
+
216
+
217
+ }());
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-open-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.16
4
+ version: 1.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-07 00:00:00.000000000 Z
11
+ date: 2018-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 1.1.16
75
+ version: 1.1.17
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 1.1.16
82
+ version: 1.1.17
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -193,6 +193,7 @@ files:
193
193
  - _pages/blog.html
194
194
  - _pages/software.html
195
195
  - _pages/specs.html
196
+ - _sass/headroom.scss
196
197
  - _sass/jekyll-theme-open-project.scss
197
198
  - _sass/normalize.scss
198
199
  - _sass/open-project-base.scss
@@ -203,7 +204,8 @@ files:
203
204
  - assets/fa/fa-solid.js
204
205
  - assets/fa/fontawesome.js
205
206
  - assets/img/external-link.svg
206
- - assets/js/menu.js
207
+ - assets/js/headroom.min.js
208
+ - assets/js/opf.js
207
209
  homepage: https://github.com/riboseinc/jekyll-theme-open-project/
208
210
  licenses:
209
211
  - MIT
data/assets/js/menu.js DELETED
@@ -1,15 +0,0 @@
1
- (function () {
2
- 'use strict';
3
-
4
- var hamBtn = document.getElementById('hamburgerButton');
5
- var hamMnu = document.getElementById('hamburgerMenu');
6
- var hasOpened = false;
7
-
8
- hamBtn.addEventListener('click', function (evt) {
9
- hasOpened = hamMnu.classList.toggle('expanded');
10
- if (hasOpened) {
11
- hamBtn.setAttribute('aria-expanded', true);
12
- hamMnu.setAttribute('aria-hidden', false);
13
- }
14
- });
15
- }());