How to install and deploy Middleman on server



middleman.jpg


Middleman - simple open-source static web site generator.

Why middleman? because:

  • More than 5000 stars on github
  • Write on Ruby
  • Using sass for stylesheets and CoffeeScript for less verbose javascript
  • More than 200 releases
  • Latest release May 2016

Top 2 contributors:

middleman-contributors.jpg

Installation

Step 1 (installation process)

Requirements:

1
gem install middleman

Step 2 (init process )

1
middleman init your_blog_name
1
cd your_blog_name
1
middleman server
1
middleman build

Deploy on server

We need an additional gem to deploy - middleman-deploy

https://github.com/middleman-contrib/middleman-deploy

Add the line in your Gemfile Middleman-project:

1
gem 'middleman-deploy', github: 'middleman-contrib/middleman-deploy', branch: 'master'

Run bundle install . It will install the gem we have added, and in the meantime we will edit config.rb file by placing lines:

1
2
3
4
5
6
activate :deploy do |deploy|
deploy.deploy_method = :sftp
deploy.host = 'you_serv_api'
deploy.port = 22
deploy.path = '/work/your_path'
end

Ok, you can save the file and close it.

There are still a few commands to do:

1
2
3
git remote add server root@ip_address:repo/site_name.git
middleman build
middleman deploy

Now you can keep all your projects, built on a design static websites on the same server and save some money on this.