Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.55 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.55 KB

Middleman Strava

Codeship Status for dbeg/middleman-strava Gem Version

middleman-strava is an extension for the Middleman static site generator that exposes helpers which return Strava API results inside your templates.

Dependencies

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

  1. Clone repository: git clone https://github.com/dbeg/middleman-strava.git && cd middleman-strava
  2. Install gem dependencies: bundle install
  3. Run test features: bundle exec rake test