#Middleman Boilerplate
This includes:
- jQuery
- Bootstrap
- Bootstrap Sass Variables
- Font Awesome
- Heroku Deployment Config
Clone the repo using the GUI or terminal. To do so in terminal, use the following:
git clone https://github.com/dannyvassallo/middleman-boilerplate.git
cd middleman-boilerplate
From the "middleman-boilerplate" directory, install the gems by running the following:
bundle install
To fire up the server while in the "middleman-boilerplate" directory use this command:
middleman s
If you are having issues with livereload not working fire up the server using:
middleman s --force-polling --verbose
To kill the server use "ctrl+c"
If you find yourself curious as to what directory you are in use the following in terminal:
pwd
It should turn up "middleman-boilerplate"
Create a new app on heroku using heroku-cli. Pass in the following:
heroku create YOUR-APP-NAME
To add an existing repository:
heroku git:remote -a YOUR-APP-NAME
To deploy, commit all changes and pass in:
git push heroku master
To deploy a non-master branch use:
git push heroku MY-NEW-BRANCH:master
###Middleman Helper Methods
Create an external link:
<%= link_to 'My Site', 'http://mysite.com' %>
Create an internal link:
<%= link_to 'About', '/about.html' %>
Link / Image tag for image in images folder:
<% link_to 'http://mysite.com' do %>
<%= image_tag 'mylogo.png' %>
<% end %>
Create a form (example):
<% form_tag '/destroy', :class => 'destroy-form', :method => 'delete' do %>
<% field_set_tag do %>
<p>
<%= label_tag :username, :class => 'first' %>
<%= text_field_tag :username, :value => params[:username] %>
</p>
<p>
<%= label_tag :password, :class => 'first' %>
<%= password_field_tag :password, :value => params[:password] %>
</p>
<p>
<%= label_tag :strategy %>
<%= select_tag :strategy, :options => ['delete', 'destroy'],
:selected => 'delete' %>
</p>
<p>
<%= check_box_tag :confirm_delete %>
</p>
<% end %>
<% field_set_tag(:class => 'buttons') do %>
<%= submit_tag "Remove" %>
<% end %>
<% end %>
Text helpers for dummy info:
USAGE:
<%= lorem.sentences 5 %>
DIFFERENT METHODS:
lorem.sentence # returns a single sentence
lorem.words 5 # returns 5 individual words
lorem.word
lorem.paragraphs 10 # returns 10 paragraphs
lorem.paragraph
lorem.date # accepts a strftime format argument
lorem.name
lorem.first_name
lorem.last_name
lorem.email
Placeholder Images:
USAGE:
<%= lorem.image('300x400') %>
DIFFERENT METHODS:
lorem.image('300x400')
#=> http://placehold.it/300x400
lorem.image('300x400', :background_color => '333', :color => 'fff')
#=> http://placehold.it/300x400/333/fff
lorem.image('300x400', :random_color => true)
#=> http://placehold.it/300x400/f47av7/9fbc34d
lorem.image('300x400', :text => 'blah')
#=> http://placehold.it/300x400&text=blah