Class: Jekyll::RemoteInclude
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::RemoteInclude
- Defined in:
- lib/jekyll-remote-include.rb
Instance Method Summary collapse
-
#initialize(tag_name, remote_include, tokens) ⇒ RemoteInclude
constructor
A new instance of RemoteInclude.
- #open(url) ⇒ Object
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, remote_include, tokens) ⇒ RemoteInclude
Returns a new instance of RemoteInclude.
8 9 10 11 |
# File 'lib/jekyll-remote-include.rb', line 8 def initialize(tag_name, remote_include, tokens) super @remote_include = remote_include end |
Instance Method Details
#open(url) ⇒ Object
13 14 15 |
# File 'lib/jekyll-remote-include.rb', line 13 def open(url) Net::HTTP.get(URI.parse(url.strip)).force_encoding 'utf-8' end |
#render(context) ⇒ Object
17 18 19 |
# File 'lib/jekyll-remote-include.rb', line 17 def render(context) open("#{@remote_include}") end |