jordanandree / middleman-api

A Middleman Extension that generates JSON and XML endpoints for template frontmatter
MIT License
18 stars 2 forks source link

Middleman API

Build Status Dependency Status

Create JSON and XML endpoints generated from template frontmatter and content.

Installation

Bundle with your Gemfile:

gem "middleman-api"

Or install the standalone Gem:

gem install "middleman-api"

Usage

Activate the extension in your config.rb:

activate :api

The extension will then look over each template in the sitemap and proxy frontmatter and content to JSON and XML endpoints.

JSON

{
  "meta": {
    "title" : "Middleman",
    "foo" : "bar"
  },
  "path" : "/index.html",
  "content" : "..."  
}

XML

<hash>
  <meta>
    <title>Middleman</title>
    <foo>bar</foo>
  </meta>
  <path>/index.html</path>
  <content>
    ...
  </content>
</hash>

Contributing

If there is any thing you'd like to contribute or fix, please:

The Cucumber features for this project assume the gem is installed, so to make any changes you will need to build and install the gem locally with your changes.

License

The middleman-api gem is Copyright 2013 Jordan Andree, distributed under the MIT License.