Static websites are cheaper and faster to develop than traditional websites and blogs. Static site generators allow you to easily develop static websites using the same tools used to develop dynamic websites. You should consider using this new modern web development tools whether you are going to develop a personal blog or your next company’s website with a product catalog.
Why static websites
Faster and cheaper to develop
Faster average page load time
Cheaper to host
Middleman is a static site generator for Ruby programmers. It is built on top of Sinatra and Rack, which means that you can easily transform your static website into a Sinatra powered web application.
With Middleman you can:
Code your website using your favorite template engines like ERB, HAML or Slim.
Organize your content using layouts, partials and helper methods. When you are finished, they will be compiled to static HTML.
No database. Use local YAML data as the main data source of your website. Don’t worrying about database-related performance and/or security issues feels pretty great.
products: - name: Ruby T-shirt price: $ 10.00 colors: - White - Red - name: Middleman Pants price: $ 15.00 colors: - Blue
<% data.products.each do |product| %> <p><%= product.name %></p> <span><%= product.price %></span> <ul> <% product.colors.each do |color| %> <li><%= color %></li> <% end %> </ul> <% end %>
Run $> middleman build command and all your Ruby code (including layouts, partials, method calls, dynamic pages, etc) will compile into static HTML pages.
middleman-syntax syntax highlighter
middleman-sync: deploy your website to Amazon S3 with just one command.
Have a nice Middleman blogging!