ttl2html 1.3.2 → 1.3.3
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/lib/ttl2html/template.rb +6 -2
- data/lib/ttl2html/version.rb +1 -1
- data/lib/ttl2html.rb +19 -0
- data/locales/en.yml +3 -0
- data/locales/ja.yml +3 -0
- data/templates/about.html.erb +23 -0
- data/templates/layout.html.erb +23 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7971e142aa8344f4ef07bea779f430a94a986014768c1876dcb4ab0e56c0c788
|
4
|
+
data.tar.gz: aa5cca9ebcc358b4f2697f68a86ce2edf998f83bbe4c67e2c11512cdf2a7e5f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f1d25cb74cdbbf69b6b7826edcdea833bc9286f9035a03a85c4f925553364da6c7a1f2713da767a75076a4c8ebc3ac064e639e04ed0c5625607f96cc2a52254
|
7
|
+
data.tar.gz: 04435256e3234d30eb7942e64a627cb6bf3e32dbe8e440f2f69711a62da4c14fc5d222d9cddc56bc11eebcd3708c8e27ea1ca0bd31e570b8be3654e8adac1eab
|
data/lib/ttl2html/template.rb
CHANGED
@@ -160,8 +160,12 @@ module TTL2HTML
|
|
160
160
|
end
|
161
161
|
def html_title(param)
|
162
162
|
titles = []
|
163
|
-
|
164
|
-
|
163
|
+
if @template.start_with? "about.html"
|
164
|
+
titles << t("about.title", title: param[:site_title])
|
165
|
+
else
|
166
|
+
titles << param[:title]
|
167
|
+
titles << param[:site_title]
|
168
|
+
end
|
165
169
|
titles.compact.join(" - ")
|
166
170
|
end
|
167
171
|
def shorten_title(title, length = 140)
|
data/lib/ttl2html/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
TTL2HTML::VERSION = "1.3.
|
1
|
+
TTL2HTML::VERSION = "1.3.3"
|
data/lib/ttl2html.rb
CHANGED
@@ -321,10 +321,29 @@ module TTL2HTML
|
|
321
321
|
license[:icon] = license_data["http://xmlns.com/foaf/0.1/thumbnail"]&.first
|
322
322
|
license[:label] = license_data["http://www.w3.org/2000/01/rdf-schema#label"]
|
323
323
|
end
|
324
|
+
if data["http://purl.org/dc/terms/publisher"]
|
325
|
+
publisher_data = @data[data["http://purl.org/dc/terms/publisher"].first]
|
326
|
+
email = publisher_data["http://xmlns.com/foaf/0.1/mbox"]&.first
|
327
|
+
contact = { email: email }
|
328
|
+
name = publisher_data["http://xmlns.com/foaf/0.1/name"]
|
329
|
+
contact[:name] = name if name
|
330
|
+
members = []
|
331
|
+
if publisher_data["http://xmlns.com/foaf/0.1/member"]
|
332
|
+
publisher_data["http://xmlns.com/foaf/0.1/member"].each do |member|
|
333
|
+
member_data = @data[member]
|
334
|
+
members << {
|
335
|
+
name: member_data["http://xmlns.com/foaf/0.1/name"],
|
336
|
+
org: member_data["http://www.w3.org/2006/vcard/ns#organization-name"]
|
337
|
+
}
|
338
|
+
end
|
339
|
+
contact[:members] = members
|
340
|
+
end
|
341
|
+
end
|
324
342
|
result = {
|
325
343
|
uri: toplevel.to_s,
|
326
344
|
description: data["http://purl.org/dc/terms/description"],
|
327
345
|
license: license,
|
346
|
+
contact: contact,
|
328
347
|
}
|
329
348
|
end
|
330
349
|
result
|
data/locales/en.yml
CHANGED
@@ -6,6 +6,9 @@ en:
|
|
6
6
|
versions: Versions
|
7
7
|
version-release: "Version %{version} released."
|
8
8
|
version-triples: "%{triples} triples"
|
9
|
+
contact: Contact
|
10
|
+
contact-contribution: "This dataset was developed by %{name}"
|
11
|
+
contact-email: "For dataset inquiries, please contact at <a href=\"%{email}\">%{email}</a>"
|
9
12
|
default:
|
10
13
|
details: Details
|
11
14
|
inverse_data: Referred resources
|
data/locales/ja.yml
CHANGED
@@ -5,6 +5,9 @@ ja:
|
|
5
5
|
versions: 更新履歴
|
6
6
|
version-release: "バージョン%{version}を公開。"
|
7
7
|
version-triples: "%{triples}トリプル"
|
8
|
+
contact: 連絡先
|
9
|
+
contact-contribution: "本データセットは %{name} が開発したものです"
|
10
|
+
contact-email: "データセットに関する問い合わせは <a href=\"%{email}\">%{email}</a> までお問い合わせください。"
|
8
11
|
default:
|
9
12
|
details: 詳細情報
|
10
13
|
inverse_data: 被参照情報
|
data/templates/about.html.erb
CHANGED
@@ -41,4 +41,27 @@
|
|
41
41
|
</div>
|
42
42
|
</div>
|
43
43
|
<%- end -%>
|
44
|
+
<%- if param[:toplevel] and param[:toplevel][:contact] -%>
|
45
|
+
<div class="row">
|
46
|
+
<div class="col-md">
|
47
|
+
<h2 id="contact"><%=h t("about.contact") %></h2>
|
48
|
+
<%- if param[:toplevel][:contact][:name] -%>
|
49
|
+
<p><%=h t("about.contact-contribution", name: get_language_literal(param[:toplevel][:contact][:name])) %></p>
|
50
|
+
<%- end -%>
|
51
|
+
<%- if param[:toplevel][:contact][:members] -%>
|
52
|
+
<ul>
|
53
|
+
<%- param[:toplevel][:contact][:members].each do |member| -%>
|
54
|
+
<li><%=h get_language_literal(member[:name]) %>
|
55
|
+
<%- if member[:org] -%>
|
56
|
+
(<%=h get_language_literal(member[:org]) %>)
|
57
|
+
<%- end -%>
|
58
|
+
<%- end -%>
|
59
|
+
</ul>
|
60
|
+
<%- end -%>
|
61
|
+
<%- if param[:toplevel][:contact][:email] -%>
|
62
|
+
<p><%= t("about.contact-email", email: param[:toplevel][:contact][:email]) %></p>
|
63
|
+
<%- end -%>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
<%- end -%>
|
44
67
|
</div>
|
data/templates/layout.html.erb
CHANGED
@@ -6,22 +6,31 @@
|
|
6
6
|
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
7
7
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
|
8
8
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
|
9
|
+
<%- if param[:css_file] -%>
|
10
|
+
<link rel="stylesheet" href="<%=h relative_path(param[:css_file]) %>">
|
11
|
+
<%- end -%>
|
12
|
+
<%- if param[:custom_css] -%>
|
13
|
+
<style type="text/css"><%=h param[:custom_css] %></style>
|
14
|
+
<%- end -%>
|
9
15
|
<title><%=h html_title(param) %></title>
|
10
16
|
<meta name="twitter:card" content="summary">
|
11
17
|
<meta name="twitter:title" content="<%=h html_title(param) %>">
|
12
18
|
</head>
|
13
19
|
<body>
|
14
|
-
<nav class="navbar navbar-expand-lg navbar-
|
20
|
+
<nav class="navbar navbar-expand-lg navbar-light">
|
21
|
+
<%- if param[:logo] -%>
|
22
|
+
<a class="navbar-brand" href="/"><img src="<%=h relative_path(param[:logo]) %>" height="30"></a>
|
23
|
+
<%- end -%>
|
15
24
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
16
25
|
<span class="navbar-toggler-icon"></span>
|
17
26
|
</button>
|
18
27
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
19
28
|
<ul class="navbar-nav mr-auto">
|
20
|
-
<li class="nav-item<%= '
|
21
|
-
<a class="
|
29
|
+
<li class="nav-item<%= ' active' if @template == "index.html.erb" %>">
|
30
|
+
<a class="nav-link" href="/">Home</a>
|
22
31
|
</li>
|
23
|
-
<li class="nav-item<%= '
|
24
|
-
<a class="
|
32
|
+
<li class="nav-item<%= ' active' if @template == "about.html.erb" %>">
|
33
|
+
<a class="nav-link" href="/about">About</a>
|
25
34
|
</li>
|
26
35
|
</ul>
|
27
36
|
</div>
|
@@ -30,7 +39,15 @@
|
|
30
39
|
<hr>
|
31
40
|
<footer>
|
32
41
|
<%- if param[:uri] -%>
|
33
|
-
<p class="
|
42
|
+
<p class="float-right"><a href="<%=h relative_path(param[:turtle_uri]) %>"><img src="https://www.w3.org/RDF/icons/rdf_flyer.24" alt="<%=h t("layout.rdf-data") %>"></a></p>
|
43
|
+
<%- end -%>
|
44
|
+
<%- if param[:admin_name] -%>
|
45
|
+
<p>
|
46
|
+
<%- if param[:copyright_year] -%>
|
47
|
+
© <%=h param[:copyright_year] %>
|
48
|
+
<%- end -%>
|
49
|
+
<%=h param[:admin_name] %>
|
50
|
+
</p>
|
34
51
|
<%- end -%>
|
35
52
|
</footer>
|
36
53
|
|
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: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masao Takaku
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|