ttl2html 2.0.6 → 2.0.7

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: c2ba13439ae39fd922568aa533324a67b761e7cccde1ec8f5d443fe7a0147d9a
4
- data.tar.gz: e214ea7dd81f5bd44d20d7012ce0cfbebe3399987d2739bb028c99bd7a05369c
3
+ metadata.gz: 3ce729d5fa24ee0f0bee7469c246866b66be29d929264cdadc0407eeca74d4ee
4
+ data.tar.gz: 765e30007a06fc04e570ad870eb503dddb0a7eefc119a24df9d6a09e32b65555
5
5
  SHA512:
6
- metadata.gz: 7ea0403e8e26f58d089f60492c09ba40cf1bf61a4a0fae601f6721352e962f010b94cd92477940eb13d30cce5bad5c09aeac49e7c1a86a463fc9d24a61bc1979
7
- data.tar.gz: 5af7c483a9568c8c1d289d4c5a9e5a824081193397425d19c517b5f7e52c9fd035bf04f46f8d73edefd9a1e703f251c321ede69aa3804175d532dc4f9d8e4a1c
6
+ metadata.gz: c382e6bdbd98bd83bdcfa658a13b1567102a71fdc52f20c47a64fa7f75b084b47a4754e485e8d3a20276029941822c6f27cacde4782244d51bf44be957e2b93b
7
+ data.tar.gz: f17d0a336b5e56d73876ef33de8936bc3250ee61dbaf0a940d3b8feb716131c2d5beb16f64c8a0c1fb9cd293db3d054bb36b421bbe07f7f0856ae48b88ed38d7
@@ -1 +1 @@
1
- TTL2HTML::VERSION = "2.0.6"
1
+ TTL2HTML::VERSION = "2.0.7"
data/lib/ttl2html.rb CHANGED
@@ -79,7 +79,13 @@ module TTL2HTML
79
79
  end
80
80
  result << @data[subject.to_s].keys.sort.map do |predicate|
81
81
  str = "<#{predicate}> "
82
- str << @data[subject.to_s][predicate].sort.map do |object|
82
+ str << @data[subject.to_s][predicate].sort_by do |object|
83
+ if /^_:/ =~ object.to_s and @data[object.to_s]
84
+ format_turtle(object, depth + 1)
85
+ else
86
+ object.to_s
87
+ end
88
+ end.map do |object|
83
89
  if /^_:/ =~ object.to_s # blank node:
84
90
  format_turtle(object, depth + 1)
85
91
  elsif RDF::URI::IRI =~ object.to_s
@@ -18,13 +18,25 @@
18
18
  <meta name="twitter:card" content="summary">
19
19
  <meta name="twitter:title" content="<%=h html_title(param) %>">
20
20
  <meta property="og:title" content="<%=h html_title(param) %>">
21
+ <%- if param[:ogp] and param[:ogp]["type"] -%>
22
+ <meta property="og:type" content="<%=h param[:ogp]["type"] %>">
23
+ <%- else -%>
21
24
  <meta property="og:type" content="website">
25
+ <%- end -%>
22
26
  <%- if param[:uri] -%>
23
27
  <meta property="og:url" content="<%=h param[:uri] %>">
24
28
  <%- end -%>
25
- <%- if param[:logo] -%>
29
+ <%- if param[:ogp] and param[:ogp]["image"] -%>
30
+ <meta property="og:image" content="<%=h URI.parse(param[:base_uri]) + param[:ogp]["image"] %>">
31
+ <%- elsif param[:logo] -%>
26
32
  <meta property="og:image" content="<%=h URI.parse(param[:base_uri]) + param[:logo] %>">
27
33
  <%- end -%>
34
+ <%- if param[:ogp] -%>
35
+ <%- param[:ogp].each do |key, value| -%>
36
+ <%- next if key == "image" or key == "type" -%>
37
+ <meta property="og:<%=h key %>" content="<%=h value %>">
38
+ <%- end -%>
39
+ <%- end -%>
28
40
  <meta name="generator" content="ttl2html <%=h TTL2HTML::VERSION %>">
29
41
  <%- if param[:google_analytics] -%>
30
42
  <script async src="https://www.googletagmanager.com/gtag/js?id=<%=h param[:google_analytics] %>"></script>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ttl2html
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masao Takaku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-12 00:00:00.000000000 Z
11
+ date: 2024-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  requirements: []
188
- rubygems_version: 3.4.10
188
+ rubygems_version: 3.5.3
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: ttl2html