Middleman Strava
middleman-strava
is an extension for the Middleman static site generator that exposes helpers which return Strava API results inside your templates.
Dependencies
- bundler
- strava-api-v3 (~> 0.6.0)
- A valid Strava access_token
Installation
Add middleman-strava
to your Gemfile
:
gem 'middleman-strava', '~> 1.0.0'
Run bundle install
.
Finally activate the extension within your config.rb
:
activate :strava, :access_token => 'YOUR_PUBLIC_ACCESS_TOKEN'
Usage
Reference middleman-strava
helpers from within your templates:
strava_athlete()
<img src="<%= strava_athlete['profile'] %>" />
strava_activities(start_date, num_days)
<ul>
<% strava_activities('2014-08-01', 7).each do |activity| %>
<li><%= activity['name'] %></li>
<% end %>
</ul>
Development
Running Tests
- Clone repository:
git clone https://github.com/dbeg/middleman-strava.git && cd middleman-strava
- Install gem dependencies:
bundle install
- Run test features:
bundle exec rake test