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.
- Ruby 1.9.2 or 1.9.3
gem install plate
Or, create a
Gemfile and add:
To generate a new site with plate, run the following command:
plate new site-name/
Building a site
To build your site, run:
Or, just run:
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
.rbfiles 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.
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 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 -
- Page/Post -
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 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
module SampleHelper def sample_helper_method "yes" end end
Then, in your
.erb view you can call
If you have any issues or find bugs running Plate, please report them on Github. While most functions should be stable, Plate is still in its infancy and certain issues may be present.
Plate is fully tested using Test Unit, Shoulda and Mocha. To run the test suite,
bundle install then run:
Challah is released under the MIT license
Contributions and pull-requests are more than welcome.