jekyll-geolexica 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/concept-source.html +1 -6
- data/_includes/localized-concept.html +1 -8
- data/lib/jekyll/geolexica.rb +1 -0
- data/lib/jekyll/geolexica/filters.rb +26 -0
- data/lib/jekyll/geolexica/version.rb +1 -1
- 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: 84b336a4bbc401ff60ff72c59f3f4e5086f6b300182b37a1a7e12bc0e532a73d
|
4
|
+
data.tar.gz: 10443bf14b7126ce05c80f1beb7130152e97cf1ed0eb7d8060ea0b725438def6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 510924b7936929b37e8bba19999d392bfbf253c5719a47389ae335594c0cf91d51496ed8eb03bf17bab689b7dd7b5dd39000fc9ea0a41bb8a21207ccc371c44a
|
7
|
+
data.tar.gz: 06d4421c7db00c7adf24e51072dfa8b8a37a028ee4a92eea2601471605daf759466e159218344d2786dde901ec34f8c590f3a2874df05c61ca38c85c48f75ed6
|
@@ -1,11 +1,6 @@
|
|
1
|
-
{%- assign english = page["eng"] -%}
|
2
1
|
<section class="field source">
|
3
2
|
<p class="field-name">source</p>
|
4
3
|
<p class="field-value">
|
5
|
-
{
|
6
|
-
<a href="{{ english.authoritative_source.link }}">{{ english.authoritative_source.ref | default: english.authoritative_source.link | escape_once }}</a>{% if english.authoritative_source.clause %}, {{ english.authoritative_source.clause }}{% endif %}
|
7
|
-
{% else %}
|
8
|
-
{{ english.authoritative_source.ref }}{% if english.authoritative_source.clause %}, {{ english.authoritative_source.clause }}{% endif %}
|
9
|
-
{% endif %}
|
4
|
+
{{ page["eng"].authoritative_source | display_authoritative_source }}
|
10
5
|
</p>
|
11
6
|
</section>
|
@@ -26,16 +26,9 @@
|
|
26
26
|
{% endif %}
|
27
27
|
|
28
28
|
{% if localized_term.authoritative_source.ref != english.authoritative_source.ref %}
|
29
|
-
{% if localized_term.authoritative_source.link %}
|
30
29
|
<p class="source localized">
|
31
|
-
[SOURCE:
|
32
|
-
{{ localized_term.authoritative_source.ref }}</a>{% if localized_term.authoritative_source.clause %}, {{ localized_term.authoritative_source.clause }}{% endif %}]
|
30
|
+
[SOURCE: {{ localized_term.authoritative_source | display_authoritative_source }}]
|
33
31
|
</p>
|
34
|
-
{% else %}
|
35
|
-
<p class="source localized">
|
36
|
-
[SOURCE: {{ localized_term.authoritative_source.ref }}{% if localized_term.authoritative_source.clause %}, {{ localized_term.authoritative_source.clause }}{% endif %}]
|
37
|
-
</p>
|
38
|
-
{% endif %}
|
39
32
|
<span class="warning">
|
40
33
|
This translated term may not be from the same source as the normative term.
|
41
34
|
</span>
|
data/lib/jekyll/geolexica.rb
CHANGED
@@ -16,6 +16,7 @@ require_relative "geolexica/configuration"
|
|
16
16
|
require_relative "geolexica/concept_page"
|
17
17
|
require_relative "geolexica/concept_serializer"
|
18
18
|
require_relative "geolexica/concepts_generator"
|
19
|
+
require_relative "geolexica/filters"
|
19
20
|
require_relative "geolexica/glossary"
|
20
21
|
require_relative "geolexica/hooks"
|
21
22
|
require_relative "geolexica/meta_pages_generator"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module Geolexica
|
3
|
+
module Filters
|
4
|
+
# Renders authoritative source hash as HTML.
|
5
|
+
#
|
6
|
+
# @param input [Hash] authoritative source hash.
|
7
|
+
# @return [String]
|
8
|
+
#
|
9
|
+
# TODO Maybe support string inputs.
|
10
|
+
def display_authoritative_source(input)
|
11
|
+
ref, clause, link = input.values_at("ref", "clause", "link") rescue nil
|
12
|
+
|
13
|
+
return "" if ref.nil? && link.nil?
|
14
|
+
|
15
|
+
ref_caption = escape_once(ref || link)
|
16
|
+
ref_part = link ? %[<a href="#{link}">#{ref_caption}</a>] : ref_caption
|
17
|
+
|
18
|
+
clause_part = clause && escape_once(clause)
|
19
|
+
|
20
|
+
[ref_part, clause_part].compact.join(", ")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
Liquid::Template.register_filter(Jekyll::Geolexica::Filters)
|
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
|
+
version: 1.5.2
|
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-
|
11
|
+
date: 2020-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -187,6 +187,7 @@ files:
|
|
187
187
|
- lib/jekyll/geolexica/concept_serializer.rb
|
188
188
|
- lib/jekyll/geolexica/concepts_generator.rb
|
189
189
|
- lib/jekyll/geolexica/configuration.rb
|
190
|
+
- lib/jekyll/geolexica/filters.rb
|
190
191
|
- lib/jekyll/geolexica/glossary.rb
|
191
192
|
- lib/jekyll/geolexica/hooks.rb
|
192
193
|
- lib/jekyll/geolexica/meta_pages_generator.rb
|
@@ -216,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
217
|
- !ruby/object:Gem::Version
|
217
218
|
version: '0'
|
218
219
|
requirements: []
|
219
|
-
rubygems_version: 3.1.
|
220
|
+
rubygems_version: 3.1.4
|
220
221
|
signing_key:
|
221
222
|
specification_version: 4
|
222
223
|
summary: Geolexica plugin for Jekyll
|