1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
Hand-crafted frontend development
Find a file
Thomas Reynolds d2196623f1 devcontainer
2020-09-15 11:52:01 -07:00
.devcontainer devcontainer 2020-09-15 11:52:01 -07:00
.github Lock pry-stack_explorer until we drop Ruby 2.5 support 2020-08-16 15:52:49 -07:00
middleman Update rubocop + use enable-frozen-string-literal (#2354) 2020-08-16 12:08:50 -07:00
middleman-cli Update rubocop + use enable-frozen-string-literal (#2354) 2020-08-16 12:08:50 -07:00
middleman-core devcontainer 2020-09-15 11:52:01 -07:00
.editorconfig Forward port some stable changes 2015-09-17 09:41:17 -07:00
.gitignore Fix issue with to_json on data proxies. For #2228 2019-02-26 09:36:03 -08:00
.rubocop.yml Update rubocop + use enable-frozen-string-literal (#2354) 2020-08-16 12:08:50 -07:00
.travis.yml Update rubocop + use enable-frozen-string-literal (#2354) 2020-08-16 12:08:50 -07:00
.yardopts Improve documentation for Middleman::Extension 2014-05-11 00:35:15 -07:00
CHANGELOG.md Prep rc2 2020-08-16 12:35:31 -07:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2018-11-11 14:52:31 -08:00
gem_rake_helper.rb 2018 cleanup 2018-09-11 11:43:07 -07:00
Gemfile Bump rubocop from 0.89.1 to 0.90.0 (#2370) 2020-09-01 12:18:55 -07:00
Gemfile.lock Bump rubocop-performance 2020-09-08 11:08:49 -07:00
ISSUE_TEMPLATE.md Create ISSUE_TEMPLATE.md (#1966) 2016-07-29 09:00:10 -07:00
LICENSE.md WIP Dependencies (#2220) 2018-11-17 11:29:37 -08:00
Rakefile Update rubocop + use enable-frozen-string-literal (#2354) 2020-08-16 12:08:50 -07:00
README.md Reference contribution guidelines in README (#2336) 2020-06-09 10:36:38 -07:00

Middleman - Makes developing websites simple

Gem Version License Build Status Gitter

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. 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 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: https://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

Contributing to Middleman

Contributions are welcomed! To get started, please see our contribution guidelines, which include information on submitting bug reports, and running the tests.

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:

spec.add_dependency 'middleman-core', '~> 4.0'

License

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