Class: Octopress::Tags::AbortTag::Tag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Octopress::Tags::AbortTag::Tag
- Defined in:
- lib/octopress-abort-tag.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ Tag
constructor
A new instance of Tag.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ Tag
Returns a new instance of Tag.
9 10 11 12 |
# File 'lib/octopress-abort-tag.rb', line 9 def initialize(tag_name, markup, tokens) super @markup = " #{markup}" end |
Instance Method Details
#render(context) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/octopress-abort-tag.rb', line 14 def render(context) if TagHelpers::Conditional.parse(@markup, context) site = context.environments.first['site'] dest = site['destination'] env = context.environments.first page_dest = File.join(dest, env['page']['url']) context.environments.first['site']['pages'].reject! do |p| p.destination(dest) == page_dest end end '' end |