A Liquid tag plugin for Jekyll that allows remote includes from external sources.
Add this line to your application's Gemfile:
group :jekyll_plugins do
gem 'jekyll-remote-include', "~> 1.1.3", github: 'ianjevans/jekyll-remote-include'
end
And then execute:
$ bundle
Or install it yourself as:
$ gem install jekyll-remote-include
Then add the following to your site's _config.yml
:
plugins:
- jekyll-remote-include
💡 If you are using a Jekyll version less than 3.5.0, use the gems
key instead of plugins
.
The tag can be used to include the entire contents of a file, or just the content between begin and end tokens, in your Jekyll pages, posts and collections.
To include the entire file:
{% remote_include https://raw.githubusercontent.com/jekyll/jekyll/master/README.markdown %}
To include only a portion of the file, specify the begin and end tokens separated by the pipe (|) character:
{% remote_include https://raw.githubusercontent.com/jekyll/jekyll/master/README.markdown|begin_token|end_token %}
If the linked file doesn't contain the begin or end tokens, the entire file will be included.
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request