• Stars
    star
    7,015
  • Rank 5,300 (Top 0.2 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 15 years ago
  • Updated 27 days ago

Reviews 5.0 (1)

10 months ago by Marc Anguera

Middleman is underrated. It's still one of the best frameworks to build static sites. It works nice for simple websites, for blogs, and due to some of its features (data + proxy + config as code), you can also build more sophisticated static web-apps.

Repository Details

Hand-crafted frontend development

Middleman - Makes developing websites simple

Gem Version CI License

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.

Why Middleman?

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.

  • Uses Sass for DRY stylesheets.
  • Bring your own asset pipeline (WebPack, Babel, Sprockets or any other).
  • Easy templating with ERb or Haml.

Middleman gives the stand-alone developer access to all these tools and many, many more.

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. For windows RubyInstaller-Devkit is also required.

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.

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

Versioning

This library aims to adhere to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, that version should be immediately yanked and/or a new version should be immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new major versions. As a result of this policy, you can (and should) specify a dependency on this gem using the Pessimistic Version Constraint with two digits of precision. For example:

gem 'middleman', '~> 4.0'

License

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

More Repositories

1

middleman-blog

Blog Engine Extension for Middleman
Gherkin
323
star
2

middlemanapp.com

Documentation for Middleman
SCSS
266
star
3

middleman-syntax

Code syntax highlighting plugin via Rouge for Middleman
Ruby
179
star
4

middleman-livereload

LiveReload support for Middleman
Ruby
118
star
5

middleman-autoprefixer

Autoprefixer integration with Middleman
Ruby
116
star
6

middleman-minify-html

A HTML whitespace minifier for Middleman
Ruby
77
star
7

middleman-sprockets

Sprockets support for Middleman
Gherkin
63
star
8

middleman-directory

Directory of Middleman extensions, templates and services
SCSS
31
star
9

middleman-asciidoc

🔰 AsciiDoc support for Middleman 4. (In Middleman 3, AsciiDoc support is provided by a core extension).
Gherkin
27
star
10

middleman-heroku

Precompile your static Middleman site when you push to Heroku
CSS
19
star
11

middleman-smusher

Use Smusher in Middleman
Ruby
18
star
12

middleman-clowncar

Clowncar responsive images for Middleman
Ruby
17
star
13

middleman-backbone

Backbone Boilerplate support for Middleman 3.0
JavaScript
15
star
14

middleman-sitemap-api

JSON API for Middleman Sitemap
Ruby
11
star
15

middleman-i18n

Internationalization extension for Middleman (Built-in to 3.0)
Ruby
11
star
16

middleman-templates-blog

Default new blog project template for Middleman
Ruby
10
star
17

middleman-templates-default

Default new project template for Middleman
Ruby
8
star
18

middleman-compass

v4+ support for Compass v1
Ruby
6
star
19

middleman-pipeline

Rake::Pipeline support for Middleman
Ruby
4
star
20

middleman-docker

Docker container for Middleman
Shell
4
star
21

middleman-templates-default-v5

Ruby
2
star
22

middleman-scss-lint

Ruby
2
star