Last active
May 30, 2016 16:29
-
-
Save lukewduncan/7583e8215a553d931b3913fcf4911e4f to your computer and use it in GitHub Desktop.
Contentful, Codeship and Middleman code snippets for Article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://codeship.com/api/v1/builds/#GRAB_BUILD_NUMBER_AND_PLACE_HERE/restart.json?api_key=YOUR_CODESHIP_API_KEY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle exec middleman s3_sync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gemfile | |
gem 'middleman', '~> 3.4.1' | |
gem 'middleman-livereload' | |
gem 'middleman-s3_sync' | |
gem 'contentful_middleman' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle exec middleman contentful | |
bundle exec middleman build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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