Sha256: ceaa3849bc9e0cd00df7c8fb12b043be6c4582d3babde27d62b5478e34ad6736

Contents?: true

Size: 439 Bytes

Versions: 11

Compression:

Stored size: 439 Bytes

Contents

require 'net/http'
require 'uri'

module Jekyll

  class RemoteInclude < Liquid::Tag

    def initialize(tag_name, remote_include, tokens)
      super
      @remote_include = remote_include
    end

    def open(url)
      Net::HTTP.get(URI.parse(url.strip)).force_encoding 'utf-8'
    end

    def render(context)
      open("#{@remote_include}")
    end

  end
end

Liquid::Template.register_tag('remote_include', Jekyll::RemoteInclude)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
casjaysdev-jekyll-theme-0.2.6 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.2.5 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.2.4 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.2.3 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.2.2 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.2.1 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.1.9 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.1.8 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.1.7 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.1.6 _plugins/jekyll-remote-include.rb
casjaysdev-jekyll-theme-0.1.4 _plugins/jekyll-remote-include.rb