# Plate [![Build Status](https://secure.travis-ci.org/jdtornow/plate.png)](http://travis-ci.org/jdtornow/plate) [![Dependency Status](https://gemnasium.com/jdtornow/plate.png?travis)](https://gemnasium.com/jdtornow/plate) Plate is a super simple static site generator and blog engine. It takes a folder full of Markdown files and turns it into a site that you can host anywhere. The output is a plain old static HTML site. In addition to basic formatting with Markdown, Plate also supports generating asset files with CoffeeScript, Sass and others. Requires Ruby 1.9.2 or 1.9.3. For additional processing, install CoffeeScript, Sass, Haml and other formatters. ## Installation gem install plate Or, create a `Gemfile` and add: gem 'plate' ## Command line To generate a new site with plate, run the following command: platify . To build your site, run: plate build Or, just run `plate` without any options to build the site. plate To show details about the site build, enable verbose mode: plate --verbose ## Directory Structure Plate observes the following folder structure in your site: * config/ - Put your global configuration settings here. * content/ - All custom content for the site, besides blog posts. Everything in this folder will be copied over to the published site. * layouts/ - Global layouts available for use on all content pages and posts. * lib/ - Extend the basic functionality of Plate with plugins in this directory. All `.rb` files will be loaded automatically. * posts/ - All blog post content for the site. Posts can be organized into sub-directories if you like. * public/ - This will be generated if it does not exist, contains the produced site. Set this as the web server root to your site for development mode. ## Extending Plate Plate is meant to be extended easily. You might want to extend the basic functionality of Plate to add additional functionality for your site. To get started, create a directory named `lib` in the root of your site. Any Ruby files (ending in `.rb`) will be automatically loaded into the stack when Plate is run. ### Callbacks Callbacks are used to call certain blocks of code when an event happens in the lifecycle of building a site. The callbacks currently available are: * Site - `before_render`, `after_render` * Page/Post - `before_render`, `after_render` Example of a callback to be run when a site completes the build: Plate::Site.register_callback :after_render do |site| puts "the site finished rendering!" end ### Helpers Helpers are modules that are automatically loaded into views. Any methods in the module will be available when you render a page. An example of a helper file located in `lib/sample_helper.rb` module SampleHelper def sample_helper_method "yes" end end Then, in your `.erb` view you can call `sample_helper_method`. ## Issues If you have any issues or find bugs running Plate, please [report them on Github](https://github.com/jdtornow/plate/issues). While most functions should be stable, Plate is still in its infancy and certain issues may be present. ## Testing Plate is fully tested using Test Unit, Shoulda and Mocha. To run the test suite, `bundle install` then run: rake test ## License Plate is released under the [MIT license](http://www.opensource.org/licenses/MIT) Contributions and pull-requests are more than welcome.