Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Jekyll plug-in to generate a posts.json file of available posts for consumption by whatever
branch: master

This branch is even with pgib:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README.md
posts_json.rb

README.md

jekyll-posts-json

A Jekyll plug-in to generate a posts.json file of available posts for consumption by whatever.

By default, this plug-in will will generate a file called posts.json in the site's destination path.

The JSON structure is as follows:

[
  {
    date:    "2013-09-19 00:00:00 -0700",
    url:     "/blog/2013/09/19/first-post",
    title:   "First post!",
    excerpt: "Wherein I talk about the first post.",
    tags:    [ "foo", "bar", "bat", "baz" ]
  }
]

You can configure the filename/output path in the Jekyll _config.yml:

posts_json_path: awesome_posts.json

This file can be loaded in via any standard AJAX means.

Alternatively, a Liquid tag is available for embedding the contents of the generated file into your page:

<script type="text/javascript">
  var posts = new Backbone.Collection();
  posts.reset({% posts_json %});
</script>
Something went wrong with that request. Please try again.