Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Middleman Extension that generates JSON and XML endpoints for template frontmatter
Cucumber Ruby CSS HTML Liquid JavaScript CoffeeScript
branch: master

readme.md

Middleman API Build 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:

  • Fork the repo
  • Make your changes
  • Add Cucumber tests for any new functionality
  • Verify all existing tests work properly
  • Make a pull request

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.

Something went wrong with that request. Please try again.