jekyll_download_link
is a Jekyll tag plugin that generates a link to the given URI,
which must be a file on the server.
The file name can be absolute or relative to the top-level directory of the website.
Usage
{% download_link cloud9.tar %}
Generates:
<a href="/cloud9.tar"><code>cloud9.tar</code></a> (4.5 KB)
Which renders as:
cloud9.tar
(4.5 KB)
Installation
Add this line to your application's Gemfile:
gem 'jekyll_download_link'
And then execute:
$ bundle install
Additional Information
More information is available on Mike Slinn’s website.
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.
Build and Install Locally
To build and install this gem onto your local machine, type:
$ bundle exec rake install
jekyll_download_link 1.0.0 built to pkg/jekyll_download_link-0.1.0.gem.
jekyll_download_link (1.0.0) installed.
Examine the newly built gem:
$ gem info jekyll_download_link
*** LOCAL GEMS ***
jekyll_download_link (1.0.0)
Author: Mike Slinn
Homepage:
https://github.com/mslinn/jekyll_download_link
License: MIT
Installed at: /home/mslinn/.gems
Generates Jekyll logger with colored output.
Demo Website
A test/demo website is provided in the demo
directory.
You can run it under a debugger, or let it run free.
The demo/_bin/debug
script can set various parameters for the demo.
View the help information with the -h
option:
$ demo/_bin/debug -h
debug - Run the demo Jekyll website.
By default the demo Jekyll website runs without restriction under ruby-debug-ide and debase.
View it at http://localhost:4444
Options:
-h Show this error message
-r Run freely, without a debugger
Debugging the Demo
To run under a debugger, for example Visual Studio Code:
-
Set breakpoints.
-
Initiate a debug session from the command line:
$ demo/bin/debug
-
Once the
Fast Debugger
signon appears, launch the Visual Studio Code launch configuration calledAttach rdebug-ide
. -
View the generated website at
http://localhost:4444
.
Build and Push to RubyGems
To release a new version,
-
Update the version number in
version.rb
. -
Commit all changes to git; if you don't the next step might fail with an unexplainable error message.
-
Run the following:
$ bundle exec rake release
The above creates a git tag for the version, commits the created tag, and pushes the new
.gem
file to RubyGems.org.
Contributing
- Fork the project
- Create a descriptively named feature branch
- Add your feature
- Submit a pull request
License
The gem is available as open source under the terms of the MIT License.