1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/README.md

103 lines
5.6 KiB
Markdown
Raw Normal View History

# Middleman - Makes developing websites simple
2011-07-11 13:19:50 -04:00
2018-09-20 12:06:01 -04:00
[![Gem Version](http://img.shields.io/gem/v/middleman.svg?style=flat)][gem]
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)][license]
2014-12-11 12:03:49 -05:00
2022-05-03 15:34:02 -04:00
**Middleman** is a static site generator using all the shortcuts and tools available in modern web development. Check out [middlemanapp.com](https://middlemanapp.com/) for detailed tutorials, including a [getting started guide](https://middlemanapp.com/basics/getting-started/). You can also follow [@middlemanapp](https://twitter.com/middlemanapp) for updates.
2011-08-06 14:33:27 -04:00
## Why Middleman?
2020-09-21 15:24:47 -04:00
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.
2020-09-21 15:24:47 -04:00
- Uses [Sass](https://sass-lang.com/) for DRY stylesheets.
- Bring your own asset pipeline (WebPack, Babel, Sprockets or any other).
- Easy templating with [ERb](https://ruby-doc.org/stdlib-2.0.0/libdoc/erb/rdoc/ERB.html) or [Haml](https://haml.info/).
2011-12-12 18:16:23 -05:00
2020-09-21 15:24:47 -04:00
**Middleman** gives the stand-alone developer access to all these tools and many, many more.
2011-12-12 18:16:23 -05:00
## Installation
2011-12-12 18:16:23 -05:00
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.
2011-12-12 18:16:23 -05:00
```
gem install middleman
```
2011-12-12 18:16:23 -05:00
## Getting Started
2011-12-12 18:16:23 -05:00
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
```
2011-12-12 18:16:23 -05:00
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
```
2011-12-12 18:16:23 -05:00
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.
2011-12-12 18:16:23 -05:00
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.
2011-12-12 18:16:23 -05:00
Finally, you will want to build your project into a stand-alone site. From the project directory:
```
middleman build
```
2011-08-05 14:54:52 -04:00
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.
2011-07-11 13:19:50 -04:00
## Learn More
2011-07-11 13:19:50 -04:00
2019-05-29 16:48:14 -04:00
A full set of in-depth instructional guides are available on the official website at: https://middlemanapp.com
2011-07-11 13:19:50 -04:00
Additionally, up-to-date generated code documentation is available on [RubyDoc]
2011-12-12 18:16:23 -05:00
## Community
2011-12-12 18:16:23 -05:00
2020-09-21 15:24:47 -04:00
The official community forum is available at: https://forum.middlemanapp.com
2011-12-12 18:16:23 -05:00
## Contributing to Middleman
2011-12-12 18:16:23 -05:00
Contributions are welcomed! To get started, please see our [contribution guidelines](https://github.com/middleman/middleman/blob/master/.github/CONTRIBUTING.md), which include information on [submitting bug reports](https://github.com/middleman/middleman/blob/master/.github/CONTRIBUTING.md#submitting-an-issue), and [running the tests](https://github.com/middleman/middleman/blob/master/.github/CONTRIBUTING.md#testing).
2011-12-12 18:16:23 -05:00
## Donate
2011-12-12 18:16:23 -05:00
2022-07-19 14:05:30 -04:00
[Click here to lend your support to Middleman](https://github.com/sponsors/tdreyno)
2011-07-11 13:19:50 -04:00
2014-05-24 05:51:18 -04:00
## Versioning
This library aims to adhere to [Semantic Versioning 2.0.0][semver]. 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][pvc] with two digits of precision. For example:
2014-07-05 21:46:39 -04:00
spec.add_dependency 'middleman-core', '~> 4.0'
2014-05-24 05:51:18 -04:00
2020-09-21 15:24:47 -04:00
[semver]: https://semver.org/
[pvc]: https://guides.rubygems.org/patterns/#pessimistic-version-constraint
2014-05-24 05:51:18 -04:00
## License
2011-11-24 01:07:34 -05:00
2020-09-21 15:24:47 -04:00
Copyright (c) 2010-today Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
2011-07-11 13:19:50 -04:00
2019-05-29 16:48:14 -04:00
[middleman]: https://middlemanapp.com
[gem]: https://rubygems.org/gems/middleman
2014-07-05 21:35:39 -04:00
[gittip]: https://www.gittip.com/middleman/
2020-09-21 15:24:47 -04:00
[rubyinstaller]: https://rubyinstaller.org/
2019-05-29 16:48:14 -04:00
[rubyinstaller-devkit]: https://rubyinstaller.org/add-ons/devkit.html
2020-09-21 15:24:47 -04:00
[rubydoc]: https://rubydoc.info/github/middleman/middleman
2019-05-29 16:48:14 -04:00
[license]: https://github.com/middleman/middleman/blob/master/LICENSE.md
[gitter]: https://gitter.im/middleman/middleman?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge