jekyll-json-ld 0.0.1 → 0.0.2
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/jekyll/json/ld.rb +8 -22
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6be50cf54ef3f123c545caa5b50b8bf1f194ab3a
|
4
|
+
data.tar.gz: eb95a9eab5cbe3b72948a4a33b8a9b6995e6c518
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba9afe5b97073ebc4f8dc8f53653add896fd61920621fed4fb4f7d499fa385004668fc13408f2833987da25f7159ecf14d4d818fe65e656445d6ba563af49cf8
|
7
|
+
data.tar.gz: 277d0e7d999bfdbd88b48542eb317fc0eb6fa31af78f63c6358c09b0db5de1b32d4b30c1938f2cd1ce5deae90777634db027256fe527822a7f47de19c3a36686
|
data/lib/jekyll/json/ld.rb
CHANGED
@@ -4,31 +4,17 @@ require "liquid"
|
|
4
4
|
module Jekyll
|
5
5
|
module JSON
|
6
6
|
module LD
|
7
|
-
# Provides the
|
8
|
-
#
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def initialize(tag_name, root_key, tokens)
|
15
|
-
super
|
16
|
-
@root_key = root_key.strip
|
17
|
-
@tokens = tokens
|
18
|
-
end
|
19
|
-
|
20
|
-
# Render is called by liquid
|
21
|
-
# @return [string] JSON-LD string enclosed
|
22
|
-
# in the appropriate script tag
|
23
|
-
def render(context)
|
24
|
-
"<script type=\"application/ld+json\">%s</script>" % context.environments[0][@root_key].to_json
|
7
|
+
# Provides the filter json_ld that renders
|
8
|
+
# a provided YAML to JSON-LD
|
9
|
+
# @param yaml [String] object to render
|
10
|
+
# @return [String] object in json-ld wrapped in the script tag of type "application/ld+json"
|
11
|
+
module JSONLDFilter
|
12
|
+
def json_ld_filter(yaml)
|
13
|
+
"<script type=\"application/ld+json\">%s</script>" % yaml.to_json
|
25
14
|
end
|
26
|
-
|
27
15
|
end
|
28
16
|
end
|
29
17
|
end
|
30
18
|
end
|
31
19
|
|
32
|
-
Liquid::Template.
|
33
|
-
"json_ld",
|
34
|
-
Jekyll::JSON::LD::JSONLDTag)
|
20
|
+
Liquid::Template.register_filter(Jekyll::JSON::LD::JSONLDFilter)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-json-ld
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Winkelmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -74,7 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- lib/jekyll/json/ld.rb
|
77
|
-
homepage: https://
|
77
|
+
homepage: https://matthi.coffee/jekyll-json-ld/
|
78
78
|
licenses:
|
79
79
|
- MIT
|
80
80
|
metadata:
|
@@ -98,6 +98,6 @@ rubyforge_project:
|
|
98
98
|
rubygems_version: 2.4.5.1
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
|
-
summary: JSON-LD Liquid
|
101
|
+
summary: JSON-LD Liquid in Jekyll
|
102
102
|
test_files: []
|
103
103
|
has_rdoc:
|