jekyll-geolexica 1.5.4 → 1.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 781327ac34b947ac0373cb20db954c62f4922623311445a2da3c62f854a048d6
4
- data.tar.gz: 6bfc61dbedcd5165e4041fa8893ecb35583fafba9040a553850df41239f80094
3
+ metadata.gz: fa082f698405c5747b8479196495e0f13c46d8abab8e805225436f51a4583bf7
4
+ data.tar.gz: c2281b410069a7eacb57eee814b0f2ba02a0f523ab6ae27ccc76216265a81d41
5
5
  SHA512:
6
- metadata.gz: a0b0a570bd48cd0846ab34ef0b1d33f36ebb5a278f58424f4172074c216f9c25eb79188814751c058e16abcf641d52b2ac5f676f271880a8b91967e01ba181e5
7
- data.tar.gz: 6a3a4a0d8c0424262331d802de8a31d16b4c160755caee798041b77c98c3768b00cbbeca9a22e9e1c38872aac94720fc12586ed32d093ccfbff4c0915c485f82
6
+ metadata.gz: 82b6e04b1eaf33573a03878d63743581c57a274ae64ec49434395b4b0cbb39de3112d97e4bd54f48bb2dc4f137ca3f0d50bed277e91a13727e998c83c71a7cd9
7
+ data.tar.gz: 13bfc507093d9beef13813c160c4d3974f5533813bf7306688606fa16d8289eb575e978f5cb9adae1daae0170605678092e747fdaa82860be0e1e8c26303b444
@@ -4,11 +4,12 @@ permalink: "/api/concepts.json"
4
4
  {
5
5
  {% for concept in site.concepts %}
6
6
  {% assign json_concept = concept.representations.json %}
7
- "{{ concept.termid }}": {
8
- "term": "{{ concept.term }}",
9
- "termid": {{ concept.termid }},
10
- "uri-html": "{{ concept.url }}",
11
- "uri-json": "{{ json_concept.url }}"
7
+ {% comment %}"append" below ensures conversion to string{% endcomment -%}
8
+ {{ concept.termid | append: '' | jsonify }}: {
9
+ "term": {{ concept.term | jsonify }},
10
+ "termid": {{ concept.termid | jsonify }},
11
+ "uri-html": {{ concept.url | jsonify }},
12
+ "uri-json": {{ json_concept.url | jsonify }}
12
13
  }{% unless forloop.last %},{% endunless %}
13
14
  {% endfor %}
14
15
  }
@@ -15,6 +15,22 @@ const LANGUAGES = (function() {
15
15
  var concepts = null;
16
16
  var latestQuery = null;
17
17
 
18
+ // TODO Support filters here maybe.
19
+ class SearchQuery {
20
+ constructor(queryString) {
21
+ this.searchWords = queryString.toLowerCase().match(/\p{Letter}+/ug) || [];
22
+ }
23
+
24
+ isEmpty() {
25
+ return this.searchWords.length == 0;
26
+ }
27
+
28
+ match(string) {
29
+ const stringLC = string.toLowerCase();
30
+ return this.searchWords.every((word) => stringLC.includes(word));
31
+ }
32
+ }
33
+
18
34
  function fetchConcepts() {
19
35
  if (concepts === null) {
20
36
  concepts = fetch(CONCEPTS_URL).then((resp) => resp.json());
@@ -25,16 +41,17 @@ function fetchConcepts() {
25
41
  async function filterAndSort(params) {
26
42
  var concepts = await fetchConcepts();
27
43
 
28
- if (params.string !== '') {
44
+ const query = new SearchQuery(params.string);
45
+
46
+ if (!query.isEmpty()) {
29
47
  concepts = concepts.map((_item) => {
30
48
  // Search all localized term names for the presence of given search string
31
49
 
32
50
  const item = Object.assign({}, _item);
33
- const queryString = params.string.toLowerCase();
34
51
  const matchingLanguages = LANGUAGES.
35
52
  filter((lang) => {
36
53
  const term = (item[lang] || {}).term;
37
- return term && term.toLowerCase().indexOf(queryString) >= 0;
54
+ return term && query.match(term);
38
55
  });
39
56
 
40
57
  if (matchingLanguages.length > 0) {
@@ -0,0 +1,3 @@
1
+ eval_gemfile File.expand_path("../Gemfile", __dir__)
2
+
3
+ gem "jekyll", "~> 4.0"
@@ -0,0 +1,3 @@
1
+ eval_gemfile File.expand_path("../Gemfile", __dir__)
2
+
3
+ gem "jekyll", "~> 4.1"
@@ -0,0 +1,3 @@
1
+ eval_gemfile File.expand_path("../Gemfile", __dir__)
2
+
3
+ gem "jekyll", "~> 4.2"
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
39
39
  # I doubt we should be worried, but there is no good reason to allow them
40
40
  # either.
41
41
  # See: https://jekyllrb.com/news/2020/06/24/jekyll-4-1-1-released/
42
- spec.add_runtime_dependency "jekyll", ">= 3.8.5", "< 4.2", "!= 4.1.0"
42
+ spec.add_runtime_dependency "jekyll", ">= 3.8.5", "< 4.3", "!= 4.1.0"
43
43
 
44
44
  spec.add_runtime_dependency "jekyll-asciidoc"
45
45
 
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Jekyll
5
5
  module Geolexica
6
- VERSION = "1.5.4".freeze
6
+ VERSION = "1.6.0".freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-geolexica
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-21 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 3.8.5
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '4.2'
22
+ version: '4.3'
23
23
  - - "!="
24
24
  - !ruby/object:Gem::Version
25
25
  version: 4.1.0
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 3.8.5
33
33
  - - "<"
34
34
  - !ruby/object:Gem::Version
35
- version: '4.2'
35
+ version: '4.3'
36
36
  - - "!="
37
37
  - !ruby/object:Gem::Version
38
38
  version: 4.1.0
@@ -120,7 +120,7 @@ dependencies:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
122
  version: '3.9'
123
- description:
123
+ description:
124
124
  email:
125
125
  - open.source@ribose.com
126
126
  executables: []
@@ -194,6 +194,9 @@ files:
194
194
  - assets/resource-viewer-placeholder.html
195
195
  - assets/style.scss
196
196
  - babel.config.js
197
+ - gemfiles/Jekyll-4.0.gemfile
198
+ - gemfiles/Jekyll-4.1.gemfile
199
+ - gemfiles/Jekyll-4.2.gemfile
197
200
  - jekyll-geolexica.gemspec
198
201
  - lib/jekyll-geolexica.rb
199
202
  - lib/jekyll/geolexica.rb
@@ -216,7 +219,7 @@ metadata:
216
219
  bug_tracker_uri: https://github.com/geolexica/geolexica-server/issues
217
220
  homepage_uri: https://open.ribose.com/
218
221
  source_code_uri: https://github.com/geolexica/geolexica-server
219
- post_install_message:
222
+ post_install_message:
220
223
  rdoc_options: []
221
224
  require_paths:
222
225
  - lib
@@ -231,8 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
234
  - !ruby/object:Gem::Version
232
235
  version: '0'
233
236
  requirements: []
234
- rubygems_version: 3.1.4
235
- signing_key:
237
+ rubygems_version: 3.2.3
238
+ signing_key:
236
239
  specification_version: 4
237
240
  summary: Geolexica plugin for Jekyll
238
241
  test_files: []