jekyll-theme-open-project 1.1.23 → 1.1.24

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 743ef6f6997140f43beb6d9735795c56fee28d897bcb80e081f10a5921625d36
4
- data.tar.gz: bdd6142500f0b231311451a231c1cbd89a40d63288d1a20a603a20e38d2e975b
3
+ metadata.gz: e8fce901d2f3924596242e699f0e9719a86a9cb071a3e854489475ac5c650529
4
+ data.tar.gz: 8fb7ff15b83a37d4c6faf071bce7d30cc8be6b2ce6535550f1ee39d1ea23e07b
5
5
  SHA512:
6
- metadata.gz: 733f3a2dcc8e506dc07d8c7830e91b57ba06417554edcd11e77158e9a59fca3a900ca91597bc4e55bced039f119feee23ab05a763b71ebafb0608f2da4a70ada
7
- data.tar.gz: bfd487f407634ee6bddafe018256d1f0f61dd8a4b81d51c1809f87237637d82d4e7dfc536fb149532c86fff0813753cc49c31da9359022567daa5ecbdc2f87bd
6
+ metadata.gz: f4600c9320dc30fea748bc24ddf95ef2b9db966d6c933088669716fa36edd3df8c244a4bc51f8a34a26fd0f90fbc36348faa186de4c938597e2c4fd92f654d57
7
+ data.tar.gz: cc18435994f4d649b31febddc894ad7b1a92ad9bcc68884c444fa53e5deb22248b237bca3dfe81dec7a6125dbffe2ac51edc89574c4fbb7caa61d13e37c08969
data/README.md CHANGED
@@ -236,6 +236,14 @@ is_hub: true
236
236
  # to individual, this would make sense:
237
237
  seo:
238
238
  type: Organization
239
+
240
+ tag_namespaces:
241
+ software:
242
+ namespace_id: "Human-readable namespace name"
243
+ # E.g.:
244
+ # writtenin: "Written in"
245
+ specs:
246
+ namespace_id: "Human-readable namespace name"
239
247
  ```
240
248
 
241
249
  ### Project, spec and software data
@@ -262,7 +270,11 @@ home_url: <URL to standalone project site>
262
270
  # percent-encode the tag in URLs. Replace " " (a regular space)
263
271
  # with "_" (underline); underlines will be rewritten as spaces when tags
264
272
  # are presented to site users.
265
- tags: [Ruby, Python, RFC]
273
+ # Tag can be prepended with a namespace to signify the type,
274
+ # e.g. chosen programming language or target viewer audience
275
+ # (see hub site configuration for tag namespace setup).
276
+ # Avoid long namespace/tag combos as they can overflow item’s card widget.
277
+ tags: [Ruby, Python, RFC, "<some_namespace_id>:<appropriate_tag>"]
266
278
  ```
267
279
 
268
280
  ### Project index page
@@ -3,27 +3,81 @@
3
3
  {% assign tags = rawtags | split: " " | uniq %}
4
4
  {% assign num_tags = tags | size %}
5
5
 
6
+ {% if include.tag %}
7
+ {% if include.tag contains ":" %}
8
+ {% assign tag_namespace = include.tag | split: ":" | first %}
9
+ {% else %}
10
+ {% assign tag_namespace = "" %}
11
+ {% endif %}
12
+ {% endif %}
13
+
6
14
  {% if num_tags > 0 %}
7
15
  <nav class="item-filter">
16
+ {% comment %}Non-namespaced tags{% endcomment %}
8
17
  <ul class="tags">
9
- <li>
10
- {% if include.tag %}
11
- <a href="{{ include.url_tag_prefix }}">All</a>
18
+ {% for tag in tags %}
19
+ {% if tag contains ":" %}
20
+ {% assign _namespace = tag | split: ":" | first %}
12
21
  {% else %}
13
- <span>All</span>
22
+ {% assign _namespace = "" %}
14
23
  {% endif %}
15
- </li>
16
24
 
17
- {% for tag in tags %}
18
- {% assign tag_human = tag | replace: "_", " " %}
19
- <li>
20
- {% if tag == include.tag %}
21
- <span>{{ tag_human }}</span>
22
- {% else %}
23
- <a href="{{ include.url_tag_prefix }}{{ tag }}">{{ tag_human }}</a>
24
- {% endif %}
25
- </li>
25
+ {% if _namespace == "" %}
26
+ <li>
27
+ {% assign tag_human = tag | replace: "_", " " %}
28
+ {% if tag == include.tag %}
29
+ <span>{{ tag_human }}</span>
30
+ {% else %}
31
+ <a href="{{ include.url_tag_prefix }}{{ tag }}">{{ tag_human }}</a>
32
+ {% endif %}
33
+ </li>
34
+ {% endif %}
26
35
  {% endfor %}
27
36
  </ul>
37
+
38
+ {% comment %}Namespaced tags{% endcomment %}
39
+ {% for namespace in site.tag_namespaces[include.tag_namespaces] %}
40
+ {% assign namespace_human = namespace[1] %}
41
+ {% assign namespace_id = namespace[0] %}
42
+
43
+ <div class="namespace">
44
+ <span class="namespace-title">{{ namespace_human }}: </span>
45
+
46
+ <ul class="tags">
47
+ {% for tag in tags %}
48
+ {% if tag contains ":" %}
49
+ {% assign _namespace = tag | split: ":" | first %}
50
+ {% else %}
51
+ {% assign _namespace = "" %}
52
+ {% endif %}
53
+
54
+ {% if _namespace == namespace_id %}
55
+ <li>
56
+ {% assign tag_human = tag | split: ":" | last | replace: "_", " " %}
57
+ {% if tag == include.tag %}
58
+ <span>{{ tag_human }}</span>
59
+ {% else %}
60
+ <a href="{{ include.url_tag_prefix }}{{ tag }}">{{ tag_human }}</a>
61
+ {% endif %}
62
+ </li>
63
+ {% endif %}
64
+ {% endfor %}
65
+ </ul>
66
+ </div>
67
+ {% endfor %}
28
68
  </nav>
29
69
  {% endif %}
70
+
71
+ {% if include.tag %}
72
+ {% assign tag_human = include.tag | split: ":" | last | replace: "_", " " %}
73
+ {% if tag_namespace != "" %}
74
+ {% assign namespace = site.tag_namespaces[include.tag_namespaces][tag_namespace] %}
75
+ {% endif %}
76
+ <header class="filter-header">
77
+ <h3 class="title">
78
+ Showing items matching
79
+ <span class="tag">{% if namespace %}<span class="namespace">{{ namespace }}:</span> {% endif %}{{ tag_human }}</span>
80
+ <a class="show-all" href="{{ include.url_tag_prefix }}">(show all)</a>
81
+ </h3>
82
+ </header>
83
+ {% endif %}
@@ -34,7 +34,7 @@
34
34
  </p>
35
35
 
36
36
  <footer class="meta">
37
- {% include tag-list.html tags=include.item.tags %}
37
+ {% include tag-list.html tags=include.item.tags item_type=include.item_type %}
38
38
 
39
39
  {% if include.item.last_update %}
40
40
  <section class="last-update">
@@ -2,8 +2,16 @@
2
2
  {% if num_tags > 0 %}
3
3
  <ul class="tags">
4
4
  {% for tag in include.tags %}
5
- {% assign tag_human = tag | replace: "_", " " %}
6
- <li>{{ tag_human }}</li>
5
+ {% if tag contains ":" %}
6
+ {% assign namespace_id = tag | split: ":" | first %}
7
+ {% assign namespace = site.tag_namespaces[include.item_type][namespace_id] %}
8
+ {% assign tag_human = tag | split: ":" | last | replace: "_", " " %}
9
+ {% else %}
10
+ {% assign tag_human = tag | replace: "_", " " %}
11
+ {% assign namespace = "" %}
12
+ {% endif %}
13
+
14
+ <li>{% if namespace != "" %}<span class="namespace">{{ namespace }}:</span> {% endif %}{{ tag_human }}</li>
7
15
  {% endfor %}
8
16
  </ul>
9
17
  {% endif %}
@@ -2,7 +2,7 @@
2
2
  layout: default
3
3
  ---
4
4
 
5
- {% include index-page-item-filter.html url_tag_prefix="/software/" items=site.all_software tag=page.tag %}
5
+ {% include index-page-item-filter.html url_tag_prefix="/software/" tag_namespaces="software" items=site.all_software tag=page.tag %}
6
6
 
7
7
  <section class="items">
8
8
  {% if site.is_hub %}
@@ -2,7 +2,7 @@
2
2
  layout: default
3
3
  ---
4
4
 
5
- {% include index-page-item-filter.html url_tag_prefix="/specs/" items=site.all_specs tag=page.tag %}
5
+ {% include index-page-item-filter.html url_tag_prefix="/specs/" tag_namespaces="specs" items=site.all_specs tag=page.tag %}
6
6
 
7
7
  <section class="items">
8
8
  {% if site.is_hub %}
@@ -142,17 +142,75 @@ main {
142
142
 
143
143
  .layout--spec-index > &,
144
144
  .layout--software-index > & {
145
+ > .filter-header {
146
+ // Shown when a tag is selected.
147
+ background-color: #fafafa;
148
+ font-size: 80%;
149
+ box-shadow: 0 4px 40px -14px rgba(0, 0, 0, 0.4);
150
+ border-radius: .5em;
151
+ margin-top: -.5em;
152
+
153
+ .title {
154
+ font-weight: normal;
155
+ text-align: center;
156
+
157
+ .tag {
158
+ white-space: nowrap;
159
+ font-weight: bold;
160
+
161
+ .namespace {
162
+ font-weight: normal;
163
+ }
164
+
165
+ &:before { content: "“"; font-weight: normal; }
166
+ &:after { content: "”"; font-weight: normal; }
167
+ }
168
+ a.show-all {
169
+ white-space: nowrap;
170
+ }
171
+ }
172
+ }
145
173
  > .item-filter {
146
- padding: 18px 40px;
174
+ padding: 18px 2em;
147
175
  background-color: #F3F3F3;
148
176
  align-self: stretch;
149
- text-align: center;
177
+ text-align: left;
178
+
179
+ .namespace, ul.tags {
180
+ font-size: 14px;
181
+ }
182
+
183
+ .namespace {
184
+ display: flex;
185
+ flex-flow: row nowrap;
186
+ align-items: flex-start;
187
+ margin-top: .5em;
188
+
189
+ .namespace-title {
190
+ margin-right: 14px;
191
+ }
192
+
193
+ &.empty {
194
+ display: none;
195
+ }
196
+
197
+ &:first-child {
198
+ margin-top: 0;
199
+ }
200
+ }
150
201
 
151
202
  ul.tags {
203
+ flex: 1;
204
+
152
205
  list-style: none;
153
206
  margin: 0;
154
207
  padding: 0;
155
- font-size: 14px;
208
+
209
+ white-space: nowrap;
210
+ overflow-x: scroll;
211
+ overflow-y: hidden;
212
+
213
+ text-overflow: ellipsis;
156
214
 
157
215
  > li {
158
216
  display: inline;
@@ -164,22 +222,30 @@ main {
164
222
  margin: 0 4px;
165
223
  padding: 3px 10px 3px 10px;
166
224
  white-space: nowrap;
225
+
226
+ &:first-child {
227
+ margin-left: -10px;
228
+ }
167
229
  }
168
230
  > a {
169
231
  color: grey;
170
232
  }
171
233
  }
234
+
235
+ &.scrolled {
236
+ text-overflow: unset;
237
+ }
172
238
  }
173
239
  }
174
240
  }
175
241
  // Item filter: color override for selected tags
176
242
  > .item-filter ul.tags li > span {
177
243
  .layout--software-index > & {
178
- color: $hub-software--primary-color;
244
+ color: $hub-software--primary-dark-color;
179
245
  background-color: rgba($hub-software--primary-color, 0.1);
180
246
  }
181
247
  .layout--spec-index > & {
182
- color: $hub-specs--primary-color;
248
+ color: $hub-specs--primary-dark-color;
183
249
  background-color: rgba($hub-specs--primary-color, 0.1);
184
250
  }
185
251
  }
@@ -48,6 +48,7 @@ a {
48
48
 
49
49
  .index-item-grid {
50
50
  margin-top: 40px;
51
+ padding: 0; // Override padding set by main section
51
52
 
52
53
  @media screen and (min-width: $bigscreen-breakpoint) {
53
54
  margin-top: 80px;
@@ -210,13 +211,22 @@ a {
210
211
  margin: 0;
211
212
  padding: 0;
212
213
 
214
+ white-space: nowrap;
215
+
216
+ .namespace {
217
+ color: lighten($main-font-color, 50%);
218
+ font-weight: normal;
219
+ }
220
+
213
221
  &::after {
214
- content: ", ";
222
+ content: " ";
223
+ margin: 0 4px;
215
224
  color: grey;
216
225
  font-weight: normal;
217
226
  }
218
227
  &:last-child::after {
219
228
  content: "";
229
+ margin: 0;
220
230
  }
221
231
 
222
232
  color: $primary-color;
@@ -4,6 +4,9 @@
4
4
 
5
5
  var body = document.querySelector('body');
6
6
 
7
+ // TODO: Best way (preferably w/o Node) to split these across files
8
+ // and concatenate/minify the result on Jekyll build?
9
+
7
10
 
8
11
 
9
12
  /* Search box in top bar */
@@ -206,6 +209,36 @@
206
209
 
207
210
 
208
211
 
212
+ /* Software/spec index filter bar */
213
+
214
+ var initIndexFilter = function(filterBar) {
215
+ var namespaces = filterBar.querySelectorAll('.namespace');
216
+
217
+ var updateScrolledStatus = function (evt) {
218
+ if (!evt.target.classList) { return; }
219
+
220
+ if (evt.target.scrollLeft > 0) {
221
+ evt.target.classList.add('scrolled');
222
+ } else {
223
+ evt.target.classList.remove('scrolled');
224
+ }
225
+ };
226
+
227
+ // Mark empty namespaces
228
+ for (let nsEl of namespaces) {
229
+ if (nsEl.querySelector('ul.tags > li') === null) {
230
+ nsEl.classList.add('empty');
231
+ }
232
+ }
233
+
234
+ // Update styling on tag bar on scroll
235
+ for (let tags of filterBar.querySelectorAll('ul.tags')) {
236
+ tags.addEventListener('scroll', updateScrolledStatus);
237
+ }
238
+ };
239
+
240
+
241
+
209
242
  // Initializing stuff
210
243
  var hamburgerMenu = initCollapsibleMenu(
211
244
  document.querySelector('header nav.top-menu'),
@@ -235,6 +268,11 @@
235
268
  if (el) { el.addEventListener('click', collapsibleDocsNav.toggle); }
236
269
  }
237
270
 
238
- initSearchWidget(topMenuEl, triggerEl, inputEl);
271
+ if (triggerEl !== null && inputEl !== null && topMenuEl !== null) {
272
+ initSearchWidget(topMenuEl, triggerEl, inputEl);
273
+ }
274
+
275
+ var indexFilterEl = document.querySelector('nav.item-filter');
276
+ initIndexFilter(indexFilterEl);
239
277
 
240
278
  }());
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.23
4
+ version: 1.1.24
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-11-11 00:00:00.000000000 Z
11
+ date: 2018-11-16 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.23
75
+ version: 1.1.24
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.23
82
+ version: 1.1.24
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement