JekyllHttp

This plugin adds a new fetch filter that allows you to include content from an HTTP URL.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add jekyll-fetch

Add the plugin to your _config.yml:

plugins:
  - jekyll-fetch

Usage

Simply pass the URL you want to fetch the content from to the filter :

{{ "https://raw.githubusercontent.com/pcouy/jekyll-fetch/main/README.md" | fetch }}

The example above will render to the raw markdown of this readme. You can chain it with the markdownify filter to render it :

{{ "https://raw.githubusercontent.com/pcouy/jekyll-fetch/main/README.md" | fetch  | markdownify }}

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

You can use your local development version of this plugin by modifying the Gemfile of your website to look like the following :

gem "jekyll-fetch", "~> VERSION", :path => "/path/to/your/local/jekyll-fetch"

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pcouy/jekyll-fetch.

License

The gem is available as open source under the terms of the MIT License.