Published 2020-10-03.
Last modified 2023-05-18.
Time to read: 1 minutes.
This page is part of the
jekyll_plugins
collection.
This plugin generates a link to the given URI, which must be a file on the server. The path can be absolute or relative to the top-level directory of the website.
Installation
Add the following highlighted line to your Jekyll project's Gemfile
,
within the jekyll_plugins
group:
Gemfile
group :jekyll_plugins do gem 'jekyll_download_link' end
And then execute:
Shell
$ bundle
Syntax
HTML or markdown
{% download_link uri %}
Usage Example
HTML or markdown
{% download_link cloud9.tar %}
Generates:
Generated HTML
<a href="/cloud9.tar"><code>cloud9.tar</code></a> (4.5 KB)
Which renders as:
cloud9.tar
(4.5 KB)