Skip to content

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

License

Notifications You must be signed in to change notification settings

pgib/jekyll-posts-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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>

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages