Created
November 30, 2013 06:33
-
-
Save keithmorris/7716052 to your computer and use it in GitHub Desktop.
This is a simple plugin for Jekyll that allows you to output Ruby Data Structures as JSON data. It supports both `json` and `json_pretty` filters. Just drop it into your _plugins/ directory and go to town.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "json" | |
module JsonFilter | |
def json(input) | |
input.to_json | |
end | |
def json_pretty(input) | |
JSON.pretty_generate(input) | |
end | |
Liquid::Template.register_filter self | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment