Class: Glim::LiquidTags::PostURL
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Glim::LiquidTags::PostURL
- Defined in:
- lib/liquid_ext.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, options) ⇒ PostURL
constructor
A new instance of PostURL.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, options) ⇒ PostURL
Returns a new instance of PostURL.
138 139 140 141 |
# File 'lib/liquid_ext.rb', line 138 def initialize(tag_name, markup, ) super @post_name = markup.strip end |
Instance Method Details
#render(context) ⇒ Object
143 144 145 146 147 148 149 |
# File 'lib/liquid_ext.rb', line 143 def render(context) if file = Jekyll.sites.last.post_links[@post_name] file.url else raise Glim::Error.new("post_url: No post found for: #{@post_name}") end end |