Hand-crafted frontend development
Find a file
Thomas Reynolds fe2f43e8a4 Merge pull request #1117 from bhollis/utf8mac
Fix a perf regression when building
2013-12-11 10:39:17 -08:00
middleman Require Ruby 1.9.3+ 2013-11-18 20:19:57 -08:00
middleman-core Commit 8e99d39570 introduced a serious regression by encoding filenames within a "delete_if" block, meaning that every path in the list of all previously built files was re-encoded every time a file was built. For large projects this causes serious slowdowns - for a 4000 file test, it went from 14s to build to around 8 minutes to build. This change fixes the builder to only encode files when the file list is initially build, removing the bottleneck. 2013-12-10 22:11:59 -08:00
.gitignore Force padrino to skip safebuffer on erb 2013-06-08 15:36:14 -07:00
.gitmodules merge more into core, use gem availability to autoload 2013-05-09 14:41:26 -07:00
.travis.yml drop Ruby 1.8, add some extra tests 2013-10-29 09:43:56 -07:00
.yardopts Fix yard options 2013-11-25 00:12:39 -08:00
CHANGELOG.md upgrade padrino. closes #1078 2013-11-19 18:10:39 -08:00
CONTRIBUTING.md Doc: topic branch link fix 2013-10-15 13:16:32 +02:00
gem_rake_helper.rb drop Ruby 1.8, add some extra tests 2013-10-29 09:43:56 -07:00
Gemfile Merge branch 'master' of github.com:middleman/middleman 2013-10-29 09:44:22 -07:00
LICENSE.md add CONTRIBUTING.md / LICENSE.md, rejig README.md / .gemspec 2013-05-17 13:34:15 +01:00
middleman.sublime-project write some file change and deletion tests for better data coverage 2013-05-29 10:59:03 -04:00
Rakefile Remove middleman-more files 2013-10-19 15:59:12 -07:00
README.md Spiffed up the opening text with links to the excellent homepage 2013-12-07 23:50:11 -05:00
vendor.yml Update vendor.yml 2013-06-04 15:23:01 -06:00

Middleman - Makes developing websites simple

Middleman is a static site generator using all the shortcuts and tools in modern web development. Check out middlemanapp.com for detailed tutorials, including a getting started guide. You can also follow @middlemanapp for updates.

Why Middleman?

The last few years have seen an explosion in the amount and variety of tools developers can use to build web applications. Ruby on Rails selects a handful of these tools:

  • Sass for DRY stylesheets
  • CoffeeScript for safer and less verbose javascript
  • Multiple asset management solutions, including Sprockets
  • ERb & Haml for dynamic pages and simplified HTML syntax

Middleman gives the stand-alone developer access to all these tools and many, many more. Why would you use a stand-alone framework instead of Ruby on Rails?

These days, many websites are built with an API in mind. Rather than package the frontend and the backend together, both can be built and deployed independently using the public API to pull data from the backend and display it on the frontend. Static websites are incredibly fast and require very little RAM. A front-end built to stand-alone can be deployed directly to the cloud or a CDN. Many designers and developers simply deliver static HTML/JS/CSS to their clients.

Installation

Middleman is built on Ruby and uses the RubyGems package manager for installation. These are usually pre-installed on Mac OS X and Linux. Windows users can install both using RubyInstaller.

gem install middleman

Getting Started

Once Middleman is installed, you will have access to the middleman command. First, let's create a new project. From the terminal:

middleman init MY_PROJECT

This will create a new Middleman project located in the "MY_PROJECT" directory. This project contains a config.rb file for configuring Middleman and a source directory for storing your pages, stylesheets, javascripts and images.

Change directories into your new project and start the preview server:

cd MY_PROJECT
middleman server

The preview server allows you to build your site, by modifying the contents of the source directory, and see your changes reflected in the browser at: http://localhost:4567/

To get started, simply develop as you normally would by building HTML, CSS, and Javascript in the source directory. When you're ready to use more complex templates, simply add the templating engine's extension to the file and start writing in that format.

For example, say I am working on a stylesheet at source/stylesheets/site.css and I'd like to start using Compass and Sass. I would rename the file to source/stylesheets/site.css.scss and Middleman will automatically begin processing that file as Sass. The same would apply to CoffeeScript (.js.coffee), Haml (.html.haml) and any other templating engine you might want to use.

Finally, you will want to build your project into a stand-alone site. From the project directory:

middleman build

This will compile your templates and output a stand-alone site which can be easily hosted or delivered to your client. The build step can also compress images, employ Javascript & CSS dependency management, minify Javascript & CSS and run additional code of your choice. Take a look at the config.rb file to see some of the most common extensions which can be activated.

Learn More

A full set of in-depth instructional guides are available on the official website at: http://middlemanapp.com.

Additionally, up-to-date generated code documentation is available on RubyDoc.

Build & Dependency Status

Gem Version Build Status Code Coverage Dependency Status Code Quality

Community

The official community forum is available at: http://forum.middlemanapp.com

Bug Reports

Github Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems: https://github.com/middleman/middleman/issues

The best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit Pull Requests containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.

How to Run Cucumber Tests

  1. Checkout Repository: git clone https://github.com/middleman/middleman.git
  2. Install Bundler: gem install bundler
  3. Run bundle install inside the project root to install the gem dependencies.
  4. Run test cases: bundle exec rake test

Donate

Click here to lend your support to Middleman

License

Copyright (c) 2010-2013 Thomas Reynolds. MIT Licensed, see LICENSE for details.