octopress-ink 1.0.0.alpha.27 → 1.0.0.alpha.28

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
  SHA1:
3
- metadata.gz: efb2eeb2e446b336fd58c729e0e6a7502f9d6bb3
4
- data.tar.gz: fe1e77611c7f66c7691b09fb6eff276d14840ba3
3
+ metadata.gz: fc46c805b9c9408a12e59be45bce38d1e60a9b98
4
+ data.tar.gz: f3235034540210c39d801bfc0afb6cd2d7b7d3a2
5
5
  SHA512:
6
- metadata.gz: 7c5f038dd274c159d5a5b41ea8defc59ea1d09a0e0db615f1de090112674560130520bddc3c5a648234e697e4a0736f5a91a2ee6c87ce2af897fa041c7b17de3
7
- data.tar.gz: 176556c8a98b88c6de0598f9e5d63207563aca913d4ce96732467e1bba711f05eb62dea30caaf221b46a7e747f4f584bc9f0f9835b40eb84149a523824331dfc
6
+ metadata.gz: 5448ac1ba45a66b2a692f1ffb1acc3e7955ac1639bb6df01d5f8c92c128edc7dedb8b7e00a47fefd0f6bc790bad94a57bf0c749b3af4ee62eb47ae44fdc991d0
7
+ data.tar.gz: 060ba433677737ad6fddc84b15b41016784c0c6a5c6138d10e987900b6590391729929c03eaae5d3dccd935b10b201067b45639d4de90fbab07a6ef6c5b0ca40
data/lib/octopress-ink.rb CHANGED
@@ -40,8 +40,6 @@ Liquid::Template.register_tag('head', Octopress::Tags::HeadBlock)
40
40
  Liquid::Template.register_tag('footer', Octopress::Tags::FooterBlock)
41
41
  Liquid::Template.register_tag('scripts', Octopress::Tags::ScriptsBlock)
42
42
  Liquid::Template.register_tag('yield', Octopress::Tags::YieldTag)
43
- Liquid::Template.register_tag('wrap_yield', Octopress::Tags::WrapTag)
44
- Liquid::Template.register_tag('wrap_render', Octopress::Tags::WrapTag)
45
43
  Liquid::Template.register_tag('wrap', Octopress::Tags::WrapTag)
46
44
  Liquid::Template.register_tag('_', Octopress::Tags::LineCommentTag)
47
45
 
@@ -15,16 +15,29 @@ module Octopress
15
15
  markup = Helpers::Conditional.parse(@markup, context)
16
16
  return unless markup
17
17
 
18
- case @tag_name
19
- when 'wrap_yield'
18
+ type = if markup =~ /^\s*yield\s(.+)/
19
+ markup = $1
20
+ 'yield'
21
+ elsif markup =~ /^\s*render\s(.+)/
22
+ markup = $1
23
+ 'render'
24
+ elsif markup =~ /^\s*include\s(.+)/
25
+ markup = $1
26
+ 'include'
27
+ else
28
+ raise IOError.new "Wrap Failed: {% wrap #{@og_markup}%} - Which type of wrap: inlcude, yield, render? - Correct syntax: {% wrap type path or var [filters] [conditions] %}"
29
+ end
30
+
31
+ case type
32
+ when 'yield'
20
33
  content = Tags::YieldTag.new('yield', markup, []).render(context)
21
- when 'wrap_render'
34
+ when 'render'
22
35
  begin
23
36
  content = Tags::RenderTag.new('render', markup, []).render(context)
24
37
  rescue => error
25
38
  error_msg error
26
39
  end
27
- when 'wrap'
40
+ when 'include'
28
41
  begin
29
42
  content = Tags::IncludeTag.new('include', markup, []).render(context)
30
43
  rescue => error
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.alpha.27"
3
+ VERSION = "1.0.0.alpha.28"
4
4
  end
5
5
  end
@@ -4,28 +4,28 @@ layout: nil
4
4
  {% assign some_bool = true %}
5
5
 
6
6
  ## Testing a simple wrap
7
- [- Testing Include -] → {% wrap foo.html %}[- {{ yield }} -]{% endwrap %}
7
+ [- Testing Include -] → {% wrap include foo.html %}[- {{ yield }} -]{% endwrap %}
8
8
 
9
9
  ## Local var passing
10
- [- Testing Include var_test -] → {% wrap foo.html some_var="var_test" %}[- {{ yield }} -]{% endwrap %}
10
+ [- Testing Include var_test -] → {% wrap include foo.html some_var="var_test" %}[- {{ yield }} -]{% endwrap %}
11
11
 
12
12
  ## Filter testing
13
- [- TESTING INCLUDE -] → {% wrap foo.html | upcase %}[- {% assign foo = 'bar' %}{{ yield }} -]{% endwrap %}
14
- [- TESTING FILTERS -] → {% wrap foo.html | replace:"Include","Filters" | upcase | %}[- {{ yield }} -]{% endwrap %}
13
+ [- TESTING INCLUDE -] → {% wrap include foo.html | upcase %}[- {% assign foo = 'bar' %}{{ yield }} -]{% endwrap %}
14
+ [- TESTING FILTERS -] → {% wrap include foo.html | replace:"Include","Filters" %}[- {{ yield | upcase }} -]{% endwrap %}
15
15
 
16
16
  ## Conditional wrap
17
- '' → '{% wrap foo.html unless true %}[- {{ yield }} -]{% endwrap %}'
18
- '' → '{% wrap foo.html unless some_bool %}[- {{ yield }} -]{% endwrap %}'
19
- [- Testing Include -] → {% wrap foo.html if true %}[- {{ yield }} -]{% endwrap %}
20
- [- Testing Include -] → {% wrap foo.html if some_bool %}[- {{ yield }} -]{% endwrap %}
17
+ '' → '{% wrap include foo.html unless true %}[- {{ yield }} -]{% endwrap %}'
18
+ '' → '{% wrap include foo.html unless some_bool %}[- {{ yield }} -]{% endwrap %}'
19
+ [- Testing Include -] → {% wrap include foo.html if true %}[- {{ yield }} -]{% endwrap %}
20
+ [- Testing Include -] → {% wrap include foo.html if some_bool %}[- {{ yield }} -]{% endwrap %}
21
21
 
22
22
  ## Plugin wraps
23
- [- include from plugin -] → {% wrap awesome-sauce:some-include.html %}[- {{ yield }} -]{% endwrap %}
24
- [- Yo Dawg, I heard you like includes. -] → {% wrap theme:greet.html greeting="Yo Dawg" %}[- {{ yield }} -]{% endwrap %}
23
+ [- include from plugin -] → {% wrap include awesome-sauce:some-include.html %}[- {{ yield }} -]{% endwrap %}
24
+ [- Yo Dawg, I heard you like includes. -] → {% wrap include theme:greet.html greeting="Yo Dawg" %}[- {{ yield }} -]{% endwrap %}
25
25
 
26
26
  ## Wrap render
27
- [- Testing Render -] → {% wrap_render test_render/_f.html %}[- {{ yield }} -]{% endwrap_render %}
27
+ [- Testing Render -] → {% wrap render test_render/_f.html %}[- {{ yield }} -]{% endwrap %}
28
28
 
29
29
  ## Wrap yield
30
30
  {% content_for test %}Testing wrap yield{% endcontent_for %}
31
- [- Testing wrap yield -] → {% wrap_yield test %}[- {{ yield }} -]{% endwrap_yield %}
31
+ [- Testing wrap yield -] → {% wrap yield test %}[- {{ yield }} -]{% endwrap %}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-ink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.27
4
+ version: 1.0.0.alpha.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis