jekyll-liquid-plus 1.0.0 → 1.0.1
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 +8 -8
- data/.travis.yml +3 -0
- data/CHANGELOG.md +7 -0
- data/README.md +2 -0
- data/lib/jekyll-liquid-plus.rb +5 -1
- data/lib/jekyll-liquid-plus/tags/render.rb +4 -4
- data/lib/jekyll-liquid-plus/tags/return.rb +2 -2
- data/lib/jekyll-liquid-plus/version.rb +1 -1
- data/test/_config.yml +1 -0
- data/test/source/_plugins/liquid-plus.rb +1 -2
- data/test/source/f/file4.html +1 -0
- data/test/source/f/file5.html +1 -0
- data/test/source/render.html +4 -0
- data/test/source/return.html +6 -0
- data/test/test.rb +5 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGI3NmEwZTU2NGMxNzMyMTQ4ODljZWZhYjhkMDk5MDliOTIwNTEwYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzNlMDg3ZGIwNTQ0MDMzYTNhOTk3ZjA5NGJhOTEzZDgzYmI1MmIxZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGZmZjM5NTQwZTFiN2UzYTEyMTJhMDM3YTMxNDM5YmJiYTE4OGM0NTQxMThk
|
10
|
+
ZTY3NWI4MTkxYjM4NTg0ZWRjODgzMjU5YzllMDhjZTAxNmEyNjAwNGI3YmEx
|
11
|
+
MTMzMjg4NDEzYzQ3ZDYyM2Y2ZjhmYTFhMWM5MWIwNDM0YzJhYzQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2NhNTMxMTdmYzEyMmRmM2MwZDU5ZGEzNTQ4MzkwOWEzMzhhOWMyMWQ4MDlm
|
14
|
+
ODZiMGE2Y2Q2MzhlOGM3NTQyODY3MGU0Mjc0NGI3NDYzZGQ5MTA3MzQ5ZWZk
|
15
|
+
ZjNmNGJjMjZlNTVmOWUxZjM1YzIzMWZhNjA4NzMwYzQyNmExNjg=
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Jekyll Liquid Plus
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/jekyll-liquid-plus) [](https://travis-ci.org/imathis/jekyll-liquid-plus)
|
4
|
+
|
3
5
|
Super powered Liquid tags for smarter Jekyll templating.
|
4
6
|
|
5
7
|
Redesigned, but backwards compatible: include, assign, capture.
|
data/lib/jekyll-liquid-plus.rb
CHANGED
@@ -95,10 +95,10 @@ module LiquidPlus
|
|
95
95
|
else
|
96
96
|
content = parse_params(content, context) if @params or @local_vars
|
97
97
|
|
98
|
-
|
99
|
-
payload = { 'page' => context.registers[:page]
|
100
|
-
|
101
|
-
|
98
|
+
page = Jekyll::ConvertiblePage.new(context.registers[:site], path, content)
|
99
|
+
payload = { 'page' => context.registers[:page] }.merge(context.registers[:site].site_payload)
|
100
|
+
page.render(payload, { registers: context.registers })
|
101
|
+
page.output.strip
|
102
102
|
end
|
103
103
|
end
|
104
104
|
elsif path
|
data/test/_config.yml
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
require 'jekyll-liquid-plus'
|
2
|
-
|
1
|
+
require File.expand_path('../../../lib/jekyll-liquid-plus.rb', File.dirname(__FILE__))
|
@@ -0,0 +1 @@
|
|
1
|
+
{% assign bar = 'foo' %}{{ bar }}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{ site.some_var }}
|
data/test/source/render.html
CHANGED
@@ -15,6 +15,10 @@ file.html → {% render file %}
|
|
15
15
|
'' → '{% render f/file.html unless true %}'
|
16
16
|
file.html → {% render f/file.html if some_bool %}
|
17
17
|
|
18
|
+
## Test variables
|
19
|
+
foo → {% render f/file4.html %}
|
20
|
+
foo → {% render f/file5.html %}
|
21
|
+
|
18
22
|
## Ternary include
|
19
23
|
file2.html → {% render (false ? f/file.html : f/file2.html) %}
|
20
24
|
file.html → {% render (some_bool ? f/file.html : f/file2.html) %}
|
data/test/source/return.html
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
---
|
2
2
|
layout: nil
|
3
3
|
date: 2013-07-21 18:59
|
4
|
+
people:
|
5
|
+
- { name: Bill }
|
6
|
+
- { name: Bob }
|
4
7
|
---
|
5
8
|
{% assign foo = 'bar' %}
|
6
9
|
|
@@ -18,6 +21,9 @@ nope → {% return (foo == 'baz' ? foo : 'nope') %}
|
|
18
21
|
nope → {% return bingo || fez || 'nope' %}
|
19
22
|
bar → {% return bingo || fez || foo %}
|
20
23
|
|
24
|
+
## Test local variables
|
25
|
+
yep → {% for person in page.people %}{% return 'yep' if person.name == 'Bill' %}{% endfor %}
|
26
|
+
|
21
27
|
## Returns with filters
|
22
28
|
2013-07-21T18:59:00-05:00 → {% return post.date or page.date | datetime | date_to_xmlschema %}
|
23
29
|
2013-07-21T18:59:00-05:00 → {% return (post ? post.date : page.date) | datetime | date_to_xmlschema %}
|
data/test/test.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
require 'pathname'
|
3
3
|
require 'colorator'
|
4
4
|
|
5
|
+
has_failed = false
|
6
|
+
|
5
7
|
def test(path)
|
6
8
|
path = Pathname.new path + '.html'
|
7
9
|
failure = []
|
@@ -27,6 +29,7 @@ def test(path)
|
|
27
29
|
if failure.size > 0
|
28
30
|
puts "failed".red + ": #{path}"
|
29
31
|
puts failure.join "\n"
|
32
|
+
has_failed = true
|
30
33
|
else
|
31
34
|
puts "passed".green + ": #{path}"
|
32
35
|
end
|
@@ -42,3 +45,5 @@ test 'wrap'
|
|
42
45
|
test 'assign'
|
43
46
|
test 'capture'
|
44
47
|
test 'return'
|
48
|
+
|
49
|
+
abort if has_failed
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-liquid-plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -74,6 +74,8 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- .gitignore
|
77
|
+
- .travis.yml
|
78
|
+
- CHANGELOG.md
|
77
79
|
- Gemfile
|
78
80
|
- LICENSE.txt
|
79
81
|
- README.md
|
@@ -102,6 +104,8 @@ files:
|
|
102
104
|
- test/source/f/file.html
|
103
105
|
- test/source/f/file2.html
|
104
106
|
- test/source/f/file3.md
|
107
|
+
- test/source/f/file4.html
|
108
|
+
- test/source/f/file5.html
|
105
109
|
- test/source/include.html
|
106
110
|
- test/source/render.html
|
107
111
|
- test/source/return.html
|