jekyll-liquid-plus 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWFkMjM5ZjE1MjA3YzI1ODQyNTk0NWViYmE3YzA1ODA0NjgzYjJiOA==
4
+ NGI3NmEwZTU2NGMxNzMyMTQ4ODljZWZhYjhkMDk5MDliOTIwNTEwYQ==
5
5
  data.tar.gz: !binary |-
6
- ZDVkNzU2NDk2NjVlYWFmNGZmOGM1OTBjODFjMGYyN2I2ZTI0ODE2MA==
6
+ YzNlMDg3ZGIwNTQ0MDMzYTNhOTk3ZjA5NGJhOTEzZDgzYmI1MmIxZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YWVmZDc5YzEyY2FmMDg2M2NiN2E5M2QyZGQ2N2ZiZWM0ZmJhODNmMTk5N2Rl
10
- ZGE3ZGFkMGZkNmM5Y2UxZmQ2M2MyYjJkM2E0ZDU0MDNjZTliMTllYjdiYzU0
11
- Y2VhNzQ5MGZlNGVkYjk5NDZhZmFiY2Q0ZWMyM2JhZDkyMzc5MTI=
9
+ OGZmZjM5NTQwZTFiN2UzYTEyMTJhMDM3YTMxNDM5YmJiYTE4OGM0NTQxMThk
10
+ ZTY3NWI4MTkxYjM4NTg0ZWRjODgzMjU5YzllMDhjZTAxNmEyNjAwNGI3YmEx
11
+ MTMzMjg4NDEzYzQ3ZDYyM2Y2ZjhmYTFhMWM5MWIwNDM0YzJhYzQ=
12
12
  data.tar.gz: !binary |-
13
- NzZjM2Q5ZjMxMGEyNjE4M2UyMGY1NWY0OGIyYzFhZjcwOWRjMTE3NmMyZTU2
14
- ZWRjNDgwZjFmNDJiN2ZhNGMzY2I2ZjQ0MzJkZTMyOGIxZTc0Zjc3MDU2Y2Q0
15
- Zjk5MGM5OTI3OTVlYjIzYTJmOTU5ZDdiOWY0M2I4ZmE0YzNlOGM=
13
+ Y2NhNTMxMTdmYzEyMmRmM2MwZDU5ZGEzNTQ4MzkwOWEzMzhhOWMyMWQ4MDlm
14
+ ODZiMGE2Y2Q2MzhlOGM3NTQyODY3MGU0Mjc0NGI3NDYzZGQ5MTA3MzQ5ZWZk
15
+ ZjNmNGJjMjZlNTVmOWUxZjM1YzIzMWZhNjA4NzMwYzQyNmExNjg=
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm: 1.9.3
3
+ script: cd test && ruby test.rb
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## 1.0.1 (2013-10-22)
4
+ - Fixed var access issues #2, #3
5
+
6
+ ## 1.0.0 (2013-08-26)
7
+ - Initial release. :)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Jekyll Liquid Plus
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/jekyll-liquid-plus.png)](http://badge.fury.io/rb/jekyll-liquid-plus) [![Build Status](https://travis-ci.org/imathis/jekyll-liquid-plus.png)](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.
@@ -1,4 +1,8 @@
1
- require "liquid"
1
+ require 'liquid'
2
+
3
+ $:.unshift File.dirname(__FILE__)
4
+
5
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
6
 
3
7
  module LiquidPlus
4
8
  autoload :IncludeTag, 'jekyll-liquid-plus/tags/include'
@@ -95,10 +95,10 @@ module LiquidPlus
95
95
  else
96
96
  content = parse_params(content, context) if @params or @local_vars
97
97
 
98
- p = Jekyll::ConvertiblePage.new(context.registers[:site], path, content)
99
- payload = { 'page' => context.registers[:page], 'site' => context.registers[:site] }
100
- p.render(payload, { registers: context.registers })
101
- p.output.strip
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
@@ -9,8 +9,8 @@ module LiquidPlus
9
9
  end
10
10
 
11
11
  def render(context)
12
- if @markup = Conditional.parse(@markup, context)
13
- Var.get_value(@markup, context)
12
+ if parsed_markup = Conditional.parse(@markup, context)
13
+ Var.get_value(parsed_markup, context)
14
14
  else
15
15
  ''
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module LiquidPlus
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -2,3 +2,4 @@ name: Your New Jekyll Site
2
2
  markdown: redcarpet
3
3
  pygments: true
4
4
  source: source
5
+ some_var: 'foo'
@@ -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 }}
@@ -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) %}
@@ -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 %}
@@ -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.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-08-28 00:00:00.000000000 Z
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