Embedding GitHub Gists in Jekyll
The jekyll-gist plugin gives Jekyll a Liquid tag for embedding code from a GitHub Gist.
Add the gem to your site’s Gemfile:
gem 'jekyll-gist'
Install the bundle:
bundle install
You can also install the gem directly:
gem install jekyll-gist
Enable the plugin in _config.yml:
plugins:
- jekyll-gist
If you use a Jekyll version earlier than 3.5.0, the configuration key is gems rather than plugins.
You can now place a Gist in a page, post, or collection item with its ID:
{% gist id %}
Replace id with the identifier from the Gist URL. The plugin generates the embed when Jekyll builds the site, which keeps the Markdown itself pleasantly small.
Enjoyed reading this?
If you found this article helpful, consider supporting my writing. Every little bit helps keep this blog going.
Related articles
- The HTTP Status Codes I Actually Check
A practical guide to common HTTP response codes, redirects, client and server errors, and the headers that explain them.
- What Makes a Website a Progressive Web App?
A practical look at service workers, web app manifests, installation, and the cases where a Progressive Web App is worth building.
- What a Static Site Generator Actually Does
A static site generator combines content and templates before deployment, producing HTML files that a web server can deliver directly.