Permalink
Browse files

fix for bad YML breaking jekyllbot post

  • Loading branch information...
1 parent fea160f commit a990776c341583231ceb46b65f8dd3c31b51b9b2 @benbalter committed Dec 27, 2012
Showing with 14 additions and 13 deletions.
  1. +1 −0 2012/12/27/introducing-jekyllbot.json
  2. +13 −13 _posts/2012-12-27-introducing-jekyllbot.md
View
1 2012/12/27/introducing-jekyllbot.json
@@ -0,0 +1 @@
+{"title":"Introducing JekyllBot","excerpt":"Automatically generate a JSON content API for Jekyll-based posts and pages. Uses Heroku, works with GitHub pages.","author":"Benjamin J. Balter","layout":"post","comments":true,"categories":["Technology"],"tags":["Jekyll","Bot","JSON","API","Open Source","GitHub","GitHub Pages","Heroku"],"published":true,"related_posts":[{"url":"/2010/09/12/wordpress-resume-plugin/","id":"/2010/09/12/wordpress-resume-plugin","title":"WordPress Resume Plugin"},{"url":"/2010/09/13/new-media-flak-megaphone-vs-cocktail-party/","id":"/2010/09/13/new-media-flak-megaphone-vs-cocktail-party","title":"New Media Flak: Megaphone vs. Cocktail Party"},{"url":"/2010/10/10/does-every-cloud-have-a-silver-lining/","id":"/2010/10/10/does-every-cloud-have-a-silver-lining","title":"Does Every Cloud Have a Silver Lining?"},{"url":"/2010/11/06/removing-the-barriers-to-organizational-agility/","id":"/2010/11/06/removing-the-barriers-to-organizational-agility","title":"Removing the Barriers to Organizational Agility\n"},{"url":"/2010/11/08/what-fourteen-century-apple-pie-teaches-us-about-sharing/","id":"/2010/11/08/what-fourteen-century-apple-pie-teaches-us-about-sharing","title":"What Fourteen-Century Apple Pie Teaches Us About Sharing\n"},{"url":"/2010/11/15/will-federal-contracting-officers-soon-have-their-heads-in-the-clouds/","id":"/2010/11/15/will-federal-contracting-officers-soon-have-their-heads-in-the-clouds","title":"Will Federal Contracting Officers Soon Have Their Heads in the Clouds?\n"},{"url":"/2010/11/29/free-trade-in-china-just-google-it/","id":"/2010/11/29/free-trade-in-china-just-google-it","title":"Free Trade in China? Just Google it."},{"url":"/2010/11/29/twitter-mentions-as-comments/","id":"/2010/11/29/twitter-mentions-as-comments","title":"Twitter Mentions as Comments WordPress Plugin\n"},{"url":"/2010/12/01/the-internet-is-series-of-tubes/","id":"/2010/12/01/the-internet-is-series-of-tubes","title":"The Internet is Series of Tubes (oh, and Tollgates too)\n"},{"url":"/2010/12/20/late-night-infomercials/","id":"/2010/12/20/late-night-infomercials","title":"Late-Night Infomercials: Guaranteed to Extend the 4th Amendment or Your Money Back"}],"url":"/2012/12/27/introducing-jekyllbot/","date":"2012-12-27 00:00:00 -0500","id":"/2012/12/27/introducing-jekyllbot","next":null,"previous":"/2012/12/26/securing-the-status-quo","content":"<p>After <a href='http://ben.balter.com/2012/10/01/welcome-to-the-post-cms-world/'>making the move to Jekyll</a>, one thing I lost was the ability to generate machine-readable representations of content. That may sound trivial, but it&#8217;s actually not considering <a href='http://ben.balter.com/2012/12/15/why-wordpress-next-version-should-just-give-it-a-rest-already/'>the RESTful direction we&#8217;re heading</a>, and is crucial if you want to manipulate content on the front-end (e.g., <a href='http://backbonejs.org/'>Backbone</a> ). The idea being, for any post or page, if you simply replace the final <code>/</code> with <code>.json</code>, you should get an API.</p>\n\n<p>I had previously written <a href='https://github.com/benbalter/benbalter.github.com/blob/master/_plugins/generate-json.rb'>a short Jekyll plugin to generate JSON representations of posts</a>, but GitHub Pages (where this site is hosted), doesn&#8217;t allow plugins for security reasons. Enter <a href='https://github.com/benbalter/jekyllbot'>JekyllBot</a>. JekyllBot lives on a (free) Heroku instance, and following any push to GitHub, <a href='https://github.com/benbalter/benbalter.github.com/commit/c9eabc198479277a819ffa2cc95e26880ef3506c'>silently generates JSON files</a> for each post, pushing the changes back to GitHub. No need to do a thing. This allows you to continue to use web-based editors like <a href='http://edit.benbalter.com/'>Prose</a>, and alleviates the need to ever touch the command line.</p>\n\n<p>How does it work? I added my Heroku instance as a post-receive hook in the repository&#8217;s settings page, and have JekyllBot running within <a href='http://www.sinatrarb.com/'>Sinatra</a> to listen for the payload. After a push, it simply runs Jekyll (with the plugin), commits to git, and pushes the repo back to GitHub if there are any changes. The secret lies in the JSON generating plugin, which places the resulting files in the source directory (rather than <code>_site</code>), allowing the files to be tracked by git, and thus silently passed through as static files by GitHub&#8217;s Pages servers when the site is built.</p>\n\n<p>With a little customization, there&#8217;s no reason this process couldn&#8217;t work with most Jekyll plugins (e.g., sitemaps, tag archives), allowing GitHub pages to support much more robust Jekyll implementations from within their existing security restrictions. Feel free to give <a href='https://github.com/benbalter/jekyllbot'>JekyllBot</a> a try on your own site, or simply add <code>.json</code> to the the URL above to see it in action.</p>"}
View
26 _posts/2012-12-27-introducing-jekyllbot.md
@@ -1,21 +1,21 @@
---
-title: Introducing JekyllBot
-excerpt: Automatically generate a JSON content API for Jekyll-based posts and pages. Uses Heroku, works with GitHub pages.
-author: Benjamin J. Balter
+title: "Introducing JekyllBot""
+excerpt: "Automatically generate a JSON content API for Jekyll-based posts and pages. Uses Heroku, works with GitHub pages."
+author: "Benjamin J. Balter"
layout: post
comments: true
-categories: Technology
+categories:
+ - Technology
tags:
- - Jekyll
- - Bot
- - JSON
- - API
- - Open Source
- - GitHub
- - GitHub Pages
- - Heroku
+ - Jekyll
+ - Bot
+ - JSON
+ - API
+ - Open Source
+ - GitHub
+ - GitHub Pages
+ - Heroku
published: true
-
---
After [making the move to Jekyll](http://ben.balter.com/2012/10/01/welcome-to-the-post-cms-world/), one thing I lost was the ability to generate machine-readable representations of content. That may sound trivial, but it's actually not considering [the RESTful direction we're heading](http://ben.balter.com/2012/12/15/why-wordpress-next-version-should-just-give-it-a-rest-already/), and is crucial if you want to manipulate content on the front-end (e.g., [Backbone](http://backbonejs.org/) ). The idea being, for any post or page, if you simply replace the final `/` with `.json`, you should get an API.

0 comments on commit a990776

Please sign in to comment.