A Jekyll plugin for dealing with money. https://rubygems.org/gems/jekyll-money
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Josh Habdas a14cd95b32
build(rubygems): update canonical source repository
6 months ago
bin Initial commit 2 years ago
lib build(rubygems): update canonical source repository 6 months ago
spec Initial commit 2 years ago
.gitignore Initial commit 2 years ago
.rspec Initial commit 2 years ago
.travis.yml Initial commit 2 years ago
Gemfile Add BigDecimal, bump patch version 2 years ago
LICENSE.txt Initial commit 2 years ago
README.md build(rubygems): update canonical source repository 6 months ago
Rakefile Initial commit 2 years ago
jekyll-money.gemspec build(rubygems): update canonical source repository 6 months ago

README.md

Jekyll Money

A Jekyll plugin for dealing with money. Because we all have to at some point.

Works by extending the functionality of the popular money RubyGem. Intends to become a full-featured way to work with money in Jekyll. It starts with a simple filter to enable the common use case of formatting of international currencies. In time the plugin should be extended to create a Tag enabling arithmetic, comparisons and currency conversion.

Installation

Add this line to your application’s Gemfile:

gem 'jekyll-money'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jekyll-money

Then, in your _config.yml file, add to or make a new array with the key plugins and the values of the gem names of the plugins you’d like to use. In this case:

plugins:
  - jekyll-money

Note: If using a version of Jekyll below 3.5.0, use gems: in place of plugins:.

Usage

Be default, the money helper formats a value as a USD currency amount using a Liquid filter.

{{ 5000 | money }}

Outputs $50.00

{{ 5000 | money: "GBP" }}

Outputs £50.00

{{ 100000000 | money: "IDR" }}

Outputs Rp1.000.000,00

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. 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 tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests welcome at https://git.habd.as/jhabdas/jekyll-money.

Credits

This plugin wouldn’t be possible without the fine work of:

License

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