Skip to content

Instantly share code, notes, and snippets.

@lukewduncan
Last active May 30, 2016 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukewduncan/7583e8215a553d931b3913fcf4911e4f to your computer and use it in GitHub Desktop.
Save lukewduncan/7583e8215a553d931b3913fcf4911e4f to your computer and use it in GitHub Desktop.
Contentful, Codeship and Middleman code snippets for Article
https://codeship.com/api/v1/builds/#GRAB_BUILD_NUMBER_AND_PLACE_HERE/restart.json?api_key=YOUR_CODESHIP_API_KEY
activate :contentful do |f|
f.access_token = ‘ACCESS TOKEN PLACED HERE’
f.space = { site: ‘13v3alztc4hd’} // this is the space ID
f.rebuild_on_webhook = true
f.content_types = {
projects: ‘projects’
}
end
bundle exec middleman s3_sync
// Gemfile
gem 'middleman', '~> 3.4.1'
gem 'middleman-livereload'
gem 'middleman-s3_sync'
gem 'contentful_middleman'
<div class=”content”>
<div class=”container”>
<div class=”row”>
<h1>Projects</h1>
<div class=”col-md-6 col-md-offset-3”>
<% data.site.projects.each do |id, partner| %>
<h2><%= partner[“name”] %></h2>
<p><%= partner[“description”] %></p>
<% end %>
</div>
</div>
</div>
</div>
bundle exec middleman contentful
bundle exec middleman build
# Use Ruby 2.2.0
rvm use 2.2.0
# Install PNGOUT (used by middleman-imageoptim)
wget http://static.jonof.id.au/dl/kenutils/pngout-20130221-linux.tar.gz
tar -xzf pngout-*-linux.tar.gz
mv pngout-*-linux/x86_64/pngout ~/bin
# Install dependencies specified in Gemfile
bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment