jekyll-geolexica 1.8.4 → 1.8.6

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: fad6a24e360f3645f7b5045502c0aba3eb9ab66845a12a2b52833cf621bcabf7
4
- data.tar.gz: 1ffe82fa1f282cf166d075577d7785e5bbcbba94626df0c1f2cde4ab8509d956
3
+ metadata.gz: 953781d4af25bb0fddf2369620b0eb6f80dbe78b5ed0513a2ccb936cb4766fcd
4
+ data.tar.gz: 92a2f81efd01b51138ad95e3c2a3821688684ec2bc544f188b558999b35d91d8
5
5
  SHA512:
6
- metadata.gz: 62285c54a481761fb7f6e58177efd4558b408682cecc4e88494ae8f5da056aebc7412eddecd062f2ba68f3ddaa48bfb6b1e93ecb9005fc25919f82dcf00e6c1c
7
- data.tar.gz: c34b102dc55691f538d33aab7a082d84af743a6819a8ad72009e6a3eea915f56f51a69ada1b6e38f58fe4e1b14ca8a0138445e094e5018779f29f3cb586ce49e
6
+ metadata.gz: 9eb581e4730853549c2560c406370a849638db0019f3da67d3893a14e9e356bf44d4ce9e0253cf87ffaac85b4edf523ee639c0129236010c284bd952a695ebeb
7
+ data.tar.gz: 17c3fabebc23db2294405d7ee8914dd0bd895759fc33c582345ade2807a5c85660fa6c4af44abda90642d0154b0f3789d0784d3c6f8f94bed966a4ddfc3ee881
@@ -1,6 +1,28 @@
1
1
  <header>
2
- <h2 class="section-title">
3
- Concept
4
- <span class="term-name">{{ page.term | escape }}</span>
5
- </h2>
2
+ <div class="header-row">
3
+ <h2>
4
+ Concept
5
+ <span class="term-name">{{ page.term | escape }}</span>
6
+ </h2>
7
+
8
+ <div class="links">
9
+ {%- assign current_url = site.url | append: page.url -%}
10
+
11
+ {% if site.suggest_translation_url %}
12
+ <div>
13
+ <a href="{{ site.suggest_translation_url }}<{{ current_url }}>" target="_blank">
14
+ Suggest translation
15
+ </a>
16
+ </div>
17
+ {% endif %}
18
+
19
+ {% if site.suggest_translation_url %}
20
+ <div>
21
+ <a href="{{ site.report_issue_url }}<{{ current_url }}>" target="_blank">
22
+ Report an issue
23
+ </a>
24
+ </div>
25
+ {% endif %}
26
+ </div>
27
+ </div>
6
28
  </header>
data/_sass/concept.scss CHANGED
@@ -195,10 +195,25 @@ body.concept > main {
195
195
  margin-left: $sideOffsetBase;
196
196
  margin-right: $sideOffsetBase;
197
197
  }
198
+
198
199
  .field {
199
200
  margin: 0 15vw 0 15vw;
200
201
  }
201
202
 
203
+ .header-row {
204
+ margin: 0 15vw 0 0;
205
+ display: flex;
206
+ }
207
+
208
+ .links {
209
+ margin-left: auto;
210
+
211
+ > div a {
212
+ color: $warningColor;
213
+ border-bottom: none;
214
+ }
215
+ }
216
+
202
217
  @media screen and (min-width: $bigscreenBreakpoint) {
203
218
  .field {
204
219
  margin-left: calc(#{$sideOffsetBase} - #{$logoOffset});
@@ -9,6 +9,17 @@ module Jekyll
9
9
  File.expand_path(glob_string, site.source)
10
10
  end
11
11
 
12
+ def localized_concepts_path
13
+ path = glossary_config["localized_concepts_path"]
14
+ return nil if path.nil? || path.empty?
15
+
16
+ File.expand_path(path, site.source)
17
+ end
18
+
19
+ def glossary_format
20
+ glossary_config["format"]
21
+ end
22
+
12
23
  def images_path
13
24
  glossary_path = glossary_config["glossary_path"]
14
25
  return nil if glossary_path.nil? || glossary_path.empty?
@@ -30,6 +41,14 @@ module Jekyll
30
41
  File.expand_path("#{glossary_path}/bibliography.yaml", site.source)
31
42
  end
32
43
 
44
+ def suggest_translation_url
45
+ glossary_config["suggest_translation_url"]
46
+ end
47
+
48
+ def report_issue_url
49
+ glossary_config["report_issue_url"]
50
+ end
51
+
33
52
  def term_languages
34
53
  glossary_config["term_languages"]
35
54
  end
@@ -40,7 +40,13 @@ module Jekyll
40
40
  def load_concept(concept_file_path)
41
41
  Jekyll.logger.debug("Geolexica:",
42
42
  "reading concept from file #{concept_file_path}")
43
- concept_hash = read_concept_file(concept_file_path)
43
+
44
+ concept_hash = if glossary_format == "paneron"
45
+ read_paneron_concept_file(concept_file_path)
46
+ else
47
+ read_concept_file(concept_file_path)
48
+ end
49
+
44
50
  preprocess_concept_hash(concept_hash)
45
51
  store Concept.new(concept_hash)
46
52
  rescue
@@ -54,6 +60,23 @@ module Jekyll
54
60
  YAML.safe_load(File.read(path), permitted_classes: [Time])
55
61
  end
56
62
 
63
+ def read_paneron_concept_file(path)
64
+ safe_load_options = { permitted_classes: [Date, Time] }
65
+ concept = YAML.safe_load(File.read(path), **safe_load_options)
66
+ concept["termid"] = concept["data"]["identifier"]
67
+
68
+ concept["data"]["localizedConcepts"].each do |lang, local_concept_id|
69
+ localized_concept_path = File.join(localized_concepts_path, "#{local_concept_id}.yaml")
70
+ concept[lang] = YAML.safe_load(File.read(localized_concept_path), **safe_load_options)["data"]
71
+
72
+ if lang == "eng" && concept[lang]
73
+ concept["term"] = concept[lang]["terms"].first["designation"]
74
+ end
75
+ end
76
+
77
+ concept
78
+ end
79
+
57
80
  # Does nothing, but some sites may replace this method.
58
81
  def preprocess_concept_hash(concept_hash)
59
82
  end
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Jekyll
5
5
  module Geolexica
6
- VERSION = "1.8.4".freeze
6
+ VERSION = "1.8.6".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.8.4
4
+ version: 1.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-25 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0'
265
265
  requirements: []
266
- rubygems_version: 3.1.6
266
+ rubygems_version: 3.3.26
267
267
  signing_key:
268
268
  specification_version: 4
269
269
  summary: Geolexica plugin for Jekyll