Create APIs from Jekyll page data.
Follow Jekyll's instructions for installing Jekyll plugins. The Jekyll::API plugin is available from the jekyll-api
gem.
- Define data as front-matter in your Markdown Jekyll pages.
- Enjoy the API.
For example, the Jekyll::API plugin will generate a /people/jill/data.json
file
{
"title": "Jill"
}
from the Jekyll page data in /people/jill.md
.
---
title: Jill
---
Hi, my name is {{ page.title }}
If you set permalink: pretty
in _config.yml
, the resulting HTTP endpoints will be:
- HTML -
/people/jill/
- JSON -
/people/jill/data.json
For post it will generate a /people/jill/post.json
file with complete post data.
- Fork it (https://github.com/gregoryjscott/jekyll-api/fork).
- Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin my-new-feature
). - Create a new Pull Request.