jekyll-geolexica 1.4.1 → 1.5.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 +4 -4
- data/_pages/{concepts-index-list.json → concept-search-index.json} +7 -2
- data/assets/js/concept-search-worker.js +12 -17
- data/assets/js/concept-search.js +22 -26
- data/lib/jekyll/geolexica.rb +4 -0
- data/lib/jekyll/geolexica/concepts_generator.rb +1 -1
- data/lib/jekyll/geolexica/version.rb +1 -1
- data/lib/tasks/deploy.rake +41 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9061ca7ab8416d7410b611eef734939fbd9e4a19ba834b197130a7200f7739b7
|
4
|
+
data.tar.gz: ce890669ec7bd794ee4c9f48c40088dd1d0ca550568279bbc8bbdb6ad8b60b8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85a90a13c2b61627fcf570dcbc462e428e0205059ef8d5d2dd76ad0bb018f176d03735e14fe5d572ce9cc8e972229ce9ea1cc7bd231950d19fec9ea5911cbcb3
|
7
|
+
data.tar.gz: 03de01f7b8f0e267e24e9017734189b3314a8fe7f4c4d87dacefdbc48f90bcba7478a494203a5008a0d3516473c240fe1c10e547029438acf2abed55c1c8bb74
|
@@ -1,11 +1,15 @@
|
|
1
1
|
---
|
2
|
-
permalink: "/api/
|
2
|
+
permalink: "/api/concept-search-index.json"
|
3
3
|
---
|
4
4
|
[
|
5
5
|
{% for concept in site.concepts %}
|
6
6
|
{
|
7
|
-
"termid": {{ concept.termid }},
|
7
|
+
"termid": {{ concept.termid | jsonify }},
|
8
8
|
"term": {{ concept.eng.terms.first.designation | jsonify }},
|
9
|
+
"term_url": {{ concept.url | jsonify }},
|
10
|
+
"sort_order": {
|
11
|
+
"natural": {{ forloop.index }}
|
12
|
+
},
|
9
13
|
|
10
14
|
{% assign english_concept = concept["eng"] %}
|
11
15
|
{% for lang in site.geolexica.term_languages %}
|
@@ -13,6 +17,7 @@ permalink: "/api/concepts-index-list.json"
|
|
13
17
|
"{{ lang }}": {% if concept[lang] %}{
|
14
18
|
"term": {{ concept[lang].terms.first.designation | jsonify }},
|
15
19
|
"id": {{ concept[lang].id | jsonify }},
|
20
|
+
"term_url": {{ concept.url | append: "#entry-lang-" | append: lang | jsonify }},
|
16
21
|
"entry_status": {{ english_concept.entry_status | jsonify }},
|
17
22
|
"language_code": {{ concept[lang].language_code | jsonify }},
|
18
23
|
"review_decision": {{ english_concept.review_decision | jsonify }}
|
@@ -1,21 +1,16 @@
|
|
1
|
+
---
|
2
|
+
---
|
1
3
|
importScripts('/assets/js/babel-polyfill.js');
|
2
4
|
|
3
|
-
const CONCEPTS_URL = '/api/
|
5
|
+
const CONCEPTS_URL = '/api/concept-search-index.json';
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
'ger',
|
13
|
-
'fre',
|
14
|
-
'fin',
|
15
|
-
'jpn',
|
16
|
-
'dan',
|
17
|
-
'chi',
|
18
|
-
];
|
7
|
+
/** For example:
|
8
|
+
* const LANGUAGES = [ 'eng', 'deu' ];
|
9
|
+
* Having a wrapper function helps not to break syntax highlight.
|
10
|
+
*/
|
11
|
+
const LANGUAGES = (function() {
|
12
|
+
return {{ site.geolexica.term_languages | jsonify }} || [];
|
13
|
+
})();
|
19
14
|
|
20
15
|
var concepts = null;
|
21
16
|
var latestQuery = null;
|
@@ -39,7 +34,7 @@ async function filterAndSort(params) {
|
|
39
34
|
const matchingLanguages = LANGUAGES.
|
40
35
|
filter((lang) => {
|
41
36
|
const term = (item[lang] || {}).term;
|
42
|
-
return term && term.toLowerCase().indexOf(
|
37
|
+
return term && term.toLowerCase().indexOf(queryString) >= 0;
|
43
38
|
});
|
44
39
|
|
45
40
|
if (matchingLanguages.length > 0) {
|
@@ -77,7 +72,7 @@ async function filterAndSort(params) {
|
|
77
72
|
});
|
78
73
|
}
|
79
74
|
|
80
|
-
return concepts.sort((item1, item2) => item1.
|
75
|
+
return concepts.sort((item1, item2) => item1.sort_order.natural - item2.sort_order.natural);
|
81
76
|
}
|
82
77
|
|
83
78
|
onmessage = async function(msg) {
|
data/assets/js/concept-search.js
CHANGED
@@ -1,22 +1,24 @@
|
|
1
|
+
---
|
2
|
+
---
|
1
3
|
(function () {
|
2
4
|
|
3
5
|
const searchWorker = new Worker('/assets/js/concept-search-worker.js');
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
'
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
/** For example:
|
8
|
+
* const LANGUAGES = [ 'eng', 'deu' ];
|
9
|
+
* Having a wrapper function helps not to break syntax highlight.
|
10
|
+
*/
|
11
|
+
const LANGUAGES = (function() {
|
12
|
+
return {{ site.geolexica.term_languages | jsonify }} || [];
|
13
|
+
})();
|
14
|
+
|
15
|
+
/** For example:
|
16
|
+
* const SEARCH_REFINEMENTS = [ 'validity' ];
|
17
|
+
* Having a wrapper function helps not to break syntax highlight.
|
18
|
+
*/
|
19
|
+
const SEARCH_REFINEMENTS = (function() {
|
20
|
+
return {{ site.geolexica.search.refinements | jsonify }} || [];
|
21
|
+
})();
|
20
22
|
|
21
23
|
|
22
24
|
// React-based concept browser
|
@@ -57,7 +59,7 @@
|
|
57
59
|
this.stringInputRef = React.createRef();
|
58
60
|
|
59
61
|
this.state = {
|
60
|
-
valid: 'valid', // Required value of the entry_status field, or undefined
|
62
|
+
valid: SEARCH_REFINEMENTS.indexOf('validity') >= 0 ? 'valid' : undefined, // Required value of the entry_status field, or undefined
|
61
63
|
string: '',
|
62
64
|
};
|
63
65
|
}
|
@@ -75,10 +77,10 @@
|
|
75
77
|
onChange: this.handleSearchStringChange}),
|
76
78
|
];
|
77
79
|
|
78
|
-
if (this.state.string.length > 1 && (
|
80
|
+
if (this.state.string.length > 1 && (SEARCH_REFINEMENTS).length > 0) {
|
79
81
|
var refineControls = [];
|
80
82
|
|
81
|
-
if (
|
83
|
+
if (SEARCH_REFINEMENTS.indexOf('validity') >= 0) {
|
82
84
|
refineControls.push(
|
83
85
|
el('div', { key: 'validity', className: 'validity' }, [
|
84
86
|
el('input', {
|
@@ -218,7 +220,7 @@
|
|
218
220
|
el('div', { key: 'search-controls', className: 'search-controls' },
|
219
221
|
el(SearchControls, {
|
220
222
|
onSearchChange: this.handleSearchQuery,
|
221
|
-
refineControls:
|
223
|
+
refineControls: SEARCH_REFINEMENTS,
|
222
224
|
})
|
223
225
|
),
|
224
226
|
];
|
@@ -265,13 +267,7 @@
|
|
265
267
|
ReactDOM.render(el(ConceptBrowser, null), document.querySelector('.browse-concepts'))
|
266
268
|
|
267
269
|
function getConceptPermalink(concept) {
|
268
|
-
|
269
|
-
return `/concepts/${concept.termid}/`;
|
270
|
-
} else if (concept.id && concept.language_code) {
|
271
|
-
return `/concepts/${concept.id}/#entry-lang-${concept.language_code}`;
|
272
|
-
} else {
|
273
|
-
return null;
|
274
|
-
}
|
270
|
+
return concept.term_url;
|
275
271
|
}
|
276
272
|
|
277
273
|
function updateBodyClass({ searchQuery, expanded }) {
|
data/lib/jekyll/geolexica.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
namespace :geolexica do
|
2
|
+
|
3
|
+
desc "Deploy site to S3"
|
4
|
+
task :s3_deploy do
|
5
|
+
s3sync_patterns_and_options = {
|
6
|
+
"*.html" => ["--content-type", "text/html; charset=utf-8"],
|
7
|
+
"*.json" => ["--content-type", "application/json; charset=utf-8"],
|
8
|
+
"*.jsonld" => ["--content-type", "application/ld+json; charset=utf-8"],
|
9
|
+
"*.tbx.xml" => ["--content-type", "application/xml; charset=utf-8"],
|
10
|
+
"*.ttl" => ["--content-type", "text/turtle; charset=utf-8"],
|
11
|
+
"*.yaml" => ["--content-type", "text/yaml; charset=utf-8"],
|
12
|
+
}
|
13
|
+
|
14
|
+
s3sync_patterns_and_options.each_pair do |pattern, options|
|
15
|
+
s3_sync "--exclude", "*", "--include", pattern, *options
|
16
|
+
end
|
17
|
+
|
18
|
+
# Remaining files
|
19
|
+
remaining_patterns = s3sync_patterns_and_options.keys
|
20
|
+
s3_sync "--include", "*", *remaining_patterns.flat_map { |k| ["--exclude", k] }
|
21
|
+
|
22
|
+
aws "configure", "set", "preview.cloudfront", "true"
|
23
|
+
|
24
|
+
aws "cloudfront", "create-invalidation",
|
25
|
+
"--distribution-id", ENV["CLOUDFRONT_DISTRIBUTION_ID"],
|
26
|
+
"--paths", "/*"
|
27
|
+
end
|
28
|
+
|
29
|
+
def s3_sync(*args)
|
30
|
+
source = "_site"
|
31
|
+
target = "s3://#{ENV["S3_BUCKET_NAME"]}"
|
32
|
+
common_options = ["--region", ENV["AWS_REGION"], "--delete", "--no-progress"]
|
33
|
+
|
34
|
+
aws "s3", "sync", source, target, *common_options, *args
|
35
|
+
end
|
36
|
+
|
37
|
+
def aws(*args)
|
38
|
+
system "aws", *args, exception: true
|
39
|
+
end
|
40
|
+
|
41
|
+
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.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -148,7 +148,7 @@ files:
|
|
148
148
|
- _layouts/resource-page.html
|
149
149
|
- _pages/404.adoc
|
150
150
|
- _pages/api/rdf-profile.ttl
|
151
|
-
- _pages/
|
151
|
+
- _pages/concept-search-index.json
|
152
152
|
- _pages/concepts-index.json
|
153
153
|
- _pages/concepts.adoc
|
154
154
|
- _pages/index.adoc
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- lib/jekyll/geolexica/hooks.rb
|
191
191
|
- lib/jekyll/geolexica/meta_pages_generator.rb
|
192
192
|
- lib/jekyll/geolexica/version.rb
|
193
|
+
- lib/tasks/deploy.rake
|
193
194
|
- package-lock.json
|
194
195
|
- package.json
|
195
196
|
homepage: https://open.ribose.com/
|