middleman-amazon-link
middleman-amazon-link is a Middleman extension that generates links to amazon on products specified.
Installation
- Specify the dependency in your project's
Gemfile
:
gem "middleman-amazon-link"
- Activate the extension in your project's
config.rb
:
# config.rb
activate :amazon_link do |amazon|
amazon.associate_tag = "xxxx-22"
amazon.aws_access_key_id = "xxxx"
amazon.aws_secret_key = "xxx"
# optional below
amazon.country = "jp"
amazon.use_cache = true
amazon.cache_dir = ".cache/amazon"
end
Usage
Call 'amazon(asin)' function in your page file:
ERB:
# Amazon Link
<%= amazon('ASINXXXXXXX', :detail) %>
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
Copyright (c) 2015 Ataru Kodaka. See LICENSE for details.