Displays a badge on a Jekyll page for the package showing its version.
Installation
Add the following to your Jekyll website's Gemfile:
group :jekyll_plugins do
gem 'jekyll_badge'
endAnd then execute:
$ bundleImage
Copy the contents of demo/blog/images/git/ to a similarly named directory on your website.
Usage
See demo/index.html for examples.
Options
Keyword Options
-
clear– Ensures the badge is rendered below preceding floating elements. -
debug– Display debugging information on the rendered page
Primary Options
Override these name/value options as required.
-
align– Align badgeleft,centerorright, defaults toright. -
alt– Alt text for badge image, also used as title for badge. Defaults toname. -
class– Override classes for generated badge, defaults torounded shadow. -
dist_url– Badge banner link target (download page), defaults tohttps://rubygems.org/gems/name. -
image– Git repository image, without the filetype, defaults to/blog/images/git/github-mark. -
name– name of component, defaults to the name of the enclosing page. -
label– displayed name of the badge, defaults toname. -
style– Additional CSS style for the badge container. -
title– Displayed text when the user hovers their mouse over the badge. Defaults to thealtvalue. -
type– Type of badge to display. Choices areruby_gem(default) andgolang. -
user_id– GitHub user id (only required for typegolang, defaults tomslinn.)
Derived Options
Derived options can be overridden, just like primary options.
-
badge_svg– URL for badge image, defaults tohttps://badge.fury.io/rb/name.svg. -
git_url_base– GitHub User URL, defaults tohttps://github.com/mslinn. -
git_url– Repository URL, defaults togit_url_base/name.
Development
After checking out this git repository, install dependencies by typing:
$ bin/setupYou should do the above before running Visual Studio Code.
Run the Tests
$ bundle exec rake testInteractive Session
The following will allow you to experiment:
$ bin/consoleLocal Installation
To install this gem onto your local machine, type:
$ bundle exec rake installTo Release A New Version
To create a git tag for the new version, push git commits and tags, and push the new version of the gem to https://rubygems.org, type:
$ bundle exec rake releaseContributing
Bug reports and pull requests are welcome at https://github.com/mslinn/jekyll_badge.
License
The gem is available as open source under the terms of the MIT License.