github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

tdreyno / middleman

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 91
    • 4
  • Source
  • Commits
  • Network (4)
  • Issues (0)
  • Wiki (4)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Home
  • Pages
  • Wiki History
  • Git Access
  • Edit
  • History
  • New Page

Add a new wiki page

Remember to link your new page! If you create a new page, no one will be able to find it unless they know the name of the page.

Alternatively, you can edit this page and add a link to the new page first.

Project Goals:

Project Goals:

The Middleman’s job is watch your template files (Haml, Sass, Erb, Builder, Less & CoffeeScript) for changes and provide a development environment for rapid site creation and prototyping. Some important features are layouts, ruby helpers and the integration of the Compass CSS library. Middleman is built upon Sinatra. In fact, the Middleman config.rb is evaluated within a Sinatra context so anything you could do in Sinatra can be done in Middleman.

The Sinatra Book (http://www.sinatrarb.com/book.html) has some great examples for creating helper functions and changing the router.

The documentation on configuration can be found on the Configuration page.

Installation:

The first step is getting the gem installed. Middleman is on gemcutter’s servers as “middleman.” Assuming your gem setup requires sudo, you can install the official release with the following command.

sudo gem install middleman

Create a Project:

Now that Middleman is installed, you can create a new project using the “mm-init” command which functions much like the “rails” command. Simply pass it a path and a new Middleman project will be generated there.

mm-init new_project_directory

Develop:

To develop against a local server, much like rails’ ./script/server command, change directories into the newly created project folder and run “mm-server.” By default, this command provides a preview server at http://localhost:4567/

mm-server

Middleman comes with a handful of helper methods which those familiar with Rails may find useful: Helpers

You can also run the server through Rack using these instructions: Rack & Heroku

Build Static HTML:

Once you’re done developing and are ready to export to static HTML, make sure you are in the project directory and run the “mm-build” command. This will compile your templates into static HTML and CSS in a build/ folder under your project.

mm-build
Last edited by tdreyno, Mon Sep 06 20:37:53 -0700 2010
Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文